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

Function applyToSubtree

packages/angular_devkit/schematics/src/rules/base.ts:168–184  ·  view source on GitHub ↗
(path: string, rules: Rule[])

Source from the content-addressed store, hash-verified

166}
167
168export function applyToSubtree(path: string, rules: Rule[]): Rule {
169 return (tree, context) => {
170 const scoped = new ScopedTree(tree, path);
171
172 return callRule(chain(rules), scoped, context).pipe(
173 map((result) => {
174 if (result === scoped) {
175 return tree;
176 } else {
177 throw new SchematicsException(
178 'Original tree must be returned from all rules when using "applyToSubtree".',
179 );
180 }
181 }),
182 );
183 };
184}

Callers 1

base_spec.tsFile · 0.90

Calls 2

callRuleFunction · 0.90
chainFunction · 0.85

Tested by

no test coverage detected