MCPcopy Create free account
hub / github.com/angular/angular / stripBlock

Function stripBlock

packages/localize/src/localize/src/localize.ts:182–186  ·  view source on GitHub ↗

* Strip a delimited "block" from the start of the `messagePart`, if it is found. * * If a marker character (:) actually appears in the content at the start of a tagged string or * after a substitution expression, where a block has not been provided the character must be * escaped with a backslas

(messagePart: string, rawMessagePart: string)

Source from the content-addressed store, hash-verified

180 * @throws an error if the block is unterminated
181 */
182function stripBlock(messagePart: string, rawMessagePart: string) {
183 return rawMessagePart.charAt(0) === BLOCK_MARKER
184 ? messagePart.substring(findEndOfBlock(messagePart, rawMessagePart) + 1)
185 : messagePart;
186}

Callers 1

$localizeFunction · 0.85

Calls 2

findEndOfBlockFunction · 0.90
charAtMethod · 0.80

Tested by

no test coverage detected