INNER CODE UNIT · JavaScript

isClaimed

tradingview/lightweight-charts · website/plugins/docs-markdown/index.js:482

	const isClaimed = (/** @type {number} */ offset) =>
		nested.some((/** @type {Edit} */ edit) => offset >= edit.start && offset < edit.end);
	/** @type {number[]} */
	const lineStarts = [];
	let common = Number.MAX_SAFE_INTEGER;
	let newline = ctx.source.indexOf('\n', from);
	while (newline !== -1 && newline + 1 < to) {
		const lineStart = newline + 1;
		const indent = measureIndent(ctx.source, lineStart, to);
		if (indent !== null && !isClaimed(lineStart)) {
			lineStarts.push(lineStart);
			common = Math.min(common, indent);
		}
		newline = ctx.source.indexOf('\n', lineStart);
	}
	if (common === 0 || common === Number.MAX_SAFE_INTEGER) {
		return;
	}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…