@angular-devkit/schematics 14.0.1 → 14.1.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics",
3
- "version": "14.0.1",
3
+ "version": "14.1.0-next.0",
4
4
  "description": "Angular Schematics - Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -18,9 +18,9 @@
18
18
  "schematics"
19
19
  ],
20
20
  "dependencies": {
21
- "@angular-devkit/core": "14.0.1",
21
+ "@angular-devkit/core": "14.1.0-next.0",
22
22
  "jsonc-parser": "3.0.0",
23
- "magic-string": "0.26.1",
23
+ "magic-string": "0.26.2",
24
24
  "ora": "5.4.1",
25
25
  "rxjs": "6.6.7"
26
26
  },
@@ -18,7 +18,7 @@ export declare function empty(): Source;
18
18
  /**
19
19
  * Chain multiple rules into a single rule.
20
20
  */
21
- export declare function chain(rules: Rule[]): Rule;
21
+ export declare function chain(rules: Iterable<Rule> | AsyncIterable<Rule>): Rule;
22
22
  /**
23
23
  * Apply multiple rules to a source, and returns the source transformed.
24
24
  */
package/src/rules/base.js CHANGED
@@ -34,8 +34,12 @@ exports.empty = empty;
34
34
  * Chain multiple rules into a single rule.
35
35
  */
36
36
  function chain(rules) {
37
- return (tree, context) => {
38
- return rules.reduce((acc, curr) => (0, call_1.callRule)(curr, acc, context), tree);
37
+ return async (initialTree, context) => {
38
+ let intermediateTree;
39
+ for await (const rule of rules) {
40
+ intermediateTree = (0, call_1.callRule)(rule, intermediateTree !== null && intermediateTree !== void 0 ? intermediateTree : initialTree, context);
41
+ }
42
+ return () => intermediateTree;
39
43
  };
40
44
  }
41
45
  exports.chain = chain;