MCPcopy
hub / github.com/angular/angular / findEndOfBlock

Function findEndOfBlock

packages/localize/src/utils/src/messages.ts:344–353  ·  view source on GitHub ↗
(cooked: string, raw: string)

Source from the content-addressed store, hash-verified

342 * @throws an error if the block is unterminated
343 */
344export function findEndOfBlock(cooked: string, raw: string): number {
345 for (let cookedIndex = 1, rawIndex = 1; cookedIndex < cooked.length; cookedIndex++, rawIndex++) {
346 if (raw[rawIndex] === '\\') {
347 rawIndex++;
348 } else if (cooked[cookedIndex] === BLOCK_MARKER) {
349 return cookedIndex;
350 }
351 }
352 throw new Error(`Unterminated $localize metadata block in "${raw}".`);
353}

Callers 3

stripBlockFunction · 0.90
messages_spec.tsFile · 0.85
splitBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…