MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / attributeEnd

Function attributeEnd

src/extraction/sfc-script.ts:332–345  ·  view source on GitHub ↗
(at: number, quote: number)

Source from the content-addressed store, hash-verified

330
331 /** The offset after the quoted attribute value at `at`, or -1. */
332 const attributeEnd = (at: number, quote: number): number => {
333 let j = at + 1;
334 while (j < n) {
335 const c = source.charCodeAt(j);
336 if (c === quote) return j + 1;
337 if (c === Ch.OpenBrace && host === 'svelte') {
338 // `class="row {odd ? "odd" : ''}"`: the expression may hold the quote.
339 const end = expressionEnd(j, 0);
340 j = end < 0 ? j + 1 : end;
341 } else j++;
342 }
343 wasted += j - at;
344 return -1;
345 };
346
347 /** The offset after the tag that starts at `at`, or `at + 1` when no tag does (`a < b`). */
348 const tagEnd = (at: number): number => {

Callers 1

tagEndFunction · 0.70

Calls 1

expressionEndFunction · 0.70

Tested by

no test coverage detected