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

Function expectTokenAtPosition

packages/compiler-cli/test/ngtsc/ngtsc_spec.ts:11649–11658  ·  view source on GitHub ↗
(
    sf: ts.SourceFile,
    pos: number,
    guard: (node: ts.Node) => node is T,
  )

Source from the content-addressed store, hash-verified

11647 });
11648
11649 function expectTokenAtPosition<T extends ts.Node>(
11650 sf: ts.SourceFile,
11651 pos: number,
11652 guard: (node: ts.Node) => node is T,
11653 ): T {
11654 // getTokenAtPosition is part of TypeScript's private API.
11655 const node = (ts as any).getTokenAtPosition(sf, pos) as ts.Node;
11656 expect(guard(node)).toBe(true);
11657 return node as T;
11658 }
11659});

Callers 1

ngtsc_spec.tsFile · 0.85

Calls 1

guardFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…