(path: string, rules: Rule[])
| 166 | } |
| 167 | |
| 168 | export 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 | } |
no test coverage detected