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

Function assert

packages/compiler-cli/linker/src/ast/utils.ts:13–21  ·  view source on GitHub ↗
(
  node: T,
  predicate: (node: T) => node is K,
  expected: string,
)

Source from the content-addressed store, hash-verified

11 * Assert that the given `node` is of the type guarded by the `predicate` function.
12 */
13export function assert<T, K extends T>(
14 node: T,
15 predicate: (node: T) => node is K,
16 expected: string,
17): asserts node is K {
18 if (!predicate(node)) {
19 throw new FatalLinkerError(node, `Unsupported syntax, expected ${expected}.`);
20 }
21}

Callers 15

parseStringLiteralMethod · 0.90
parseNumericLiteralMethod · 0.90
parseArrayLiteralMethod · 0.90
parseObjectLiteralMethod · 0.90
parseReturnValueMethod · 0.90
parseParametersMethod · 0.90
parseCalleeMethod · 0.90
parseArgumentsMethod · 0.90
parseStringLiteralMethod · 0.90
parseNumericLiteralMethod · 0.90
parseArrayLiteralMethod · 0.90
parseObjectLiteralMethod · 0.90

Calls 1

predicateFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…