MCPcopy Index your code
hub / github.com/angular/angular / splitBlock

Function splitBlock

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

Source from the content-addressed store, hash-verified

317 * @throws an error if the `block` is unterminated
318 */
319export function splitBlock(cooked: string, raw: string): {text: string; block?: string} {
320 if (raw.charAt(0) !== BLOCK_MARKER) {
321 return {text: cooked};
322 } else {
323 const endOfBlock = findEndOfBlock(cooked, raw);
324 return {
325 block: cooked.substring(1, endOfBlock),
326 text: cooked.substring(endOfBlock + 1),
327 };
328 }
329}
330
331function computePlaceholderName(index: number) {
332 return index === 1 ? 'PH' : `PH_${index - 1}`;

Callers 3

messages_spec.tsFile · 0.85
parseMetadataFunction · 0.85
parsePlaceholderFunction · 0.85

Calls 2

findEndOfBlockFunction · 0.85
charAtMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…