node_modules/eslint-plugin-svelte3/index.js
/**
 * Get the line and character position of an offset
 * @param offset Idx of the offset
 * @param text The text for which the position should be retrieved
 */
Get the line and character position of an offset
@param offset Idx of the offset
@param text The text for which the position should be retrieved
Get the line and character position of an offset @param offset Idx of the offset @param text The text for which the position should be retrieved
function position_at(offset, text) {
	offset = clamp(offset, 0, text.length);
	const line_offsets = get_line_offsets(text);
	let low = 0;
	let high = line_offsets.length;
	if (high === 0) {
		return { line: 0, column: offset };
	}
	while (low < high) {
		const mid = Math.floor((low + high) / 2);
		if (line_offsets[mid] > offset) {
			high = mid;
		} else {
			low = mid + 1;
		}
	}
	const line = low - 1;
	return { line, column: offset - line_offsets[line] };
}
function position_at ( offset , text ) { offset = clamp ( offset , 0 , text . length ) ; const line_offsets = get_line_offsets ( text ) ; let low = 0 ; let high = line_offsets . length ; if ( high === 0 ) { return { line : 0 , column : offset } ; } while ( low < high ) { const mid = Math . floor ( ( low + high ) / 2 ) ; if ( line_offsets [ mid ] > offset ) { high = mid ; } else { low = mid + 1 ; } } const line = low - 1 ; return { line , column : offset - line_offsets [ line ] } ; }
Get the line and character position of an offset
 @param offset Idx of the offset
 @param text The text for which the position should be retrieved
Get the line and character position of an offset @param offset Idx of the offset @param text The text for which the position should be retrieved
// low is the least x for which the line offset is larger than the current offset // or array.length if no line offset is larger than the current offset