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

Function callRule

packages/angular_devkit/schematics/src/rules/call.ts:65–75  ·  view source on GitHub ↗
(
  rule: Rule,
  input: Tree | Observable<Tree>,
  context: SchematicContext,
)

Source from the content-addressed store, hash-verified

63}
64
65export function callRule(
66 rule: Rule,
67 input: Tree | Observable<Tree>,
68 context: SchematicContext,
69): Observable<Tree> {
70 if (isObservable(input)) {
71 return input.pipe(mergeMap((inputTree) => callRuleAsync(rule, inputTree, context)));
72 } else {
73 return defer(() => callRuleAsync(rule, input, context));
74 }
75}
76
77async function callRuleAsync(rule: Rule, tree: Tree, context: SchematicContext): Promise<Tree> {
78 let result = await rule(tree, context);

Callers 15

testRuleFunction · 0.90
testRuleFunction · 0.90
testRuleFunction · 0.90
callMethod · 0.90
chainFunction · 0.90
applyFunction · 0.90
asSourceFunction · 0.90
branchAndMergeFunction · 0.90
partitionApplyMergeFunction · 0.90
applyToSubtreeFunction · 0.90
base_spec.tsFile · 0.90
template_spec.tsFile · 0.90

Calls 1

callRuleAsyncFunction · 0.85

Tested by

no test coverage detected