MCPcopy Index your code
hub / github.com/angular/angular-cli / callSource

Function callSource

packages/angular_devkit/schematics/src/rules/call.ts:49–63  ·  view source on GitHub ↗
(source: Source, context: SchematicContext)

Source from the content-addressed store, hash-verified

47}
48
49export function callSource(source: Source, context: SchematicContext): Observable<Tree> {
50 return defer(async () => {
51 let result: Tree | Observable<Tree> | undefined = source(context);
52
53 if (isObservable(result)) {
54 result = await lastValueFrom(result.pipe(defaultIfEmpty(undefined)));
55 }
56
57 if (result && TreeSymbol in result) {
58 return result;
59 }
60
61 throw new InvalidSourceResultException(result);
62 });
63}
64
65export function callRule(
66 rule: Rule,

Callers 4

applyFunction · 0.90
mergeWithFunction · 0.90
base_spec.tsFile · 0.90
call_spec.tsFile · 0.90

Calls 1

sourceFunction · 0.70

Tested by

no test coverage detected