@angular-devkit/schematics 12.0.1 → 12.0.5

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/sink/host.js +9 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics",
3
- "version": "12.0.1",
3
+ "version": "12.0.5",
4
4
  "description": "Angular Schematics - Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -18,7 +18,7 @@
18
18
  "schematics"
19
19
  ],
20
20
  "dependencies": {
21
- "@angular-devkit/core": "12.0.1",
21
+ "@angular-devkit/core": "12.0.5",
22
22
  "ora": "5.4.0",
23
23
  "rxjs": "6.6.7"
24
24
  },
@@ -27,7 +27,7 @@
27
27
  "url": "https://github.com/angular/angular-cli.git"
28
28
  },
29
29
  "engines": {
30
- "node": "^12.14.1 || ^14.0.0",
30
+ "node": "^12.14.1 || >=14.0.0",
31
31
  "npm": "^6.11.0 || ^7.5.6",
32
32
  "yarn": ">= 1.13.0"
33
33
  },
package/src/sink/host.js CHANGED
@@ -29,15 +29,18 @@ class HostSink extends sink_1.SimpleSinkBase {
29
29
  if (this._filesToCreate.has(p) || this._filesToUpdate.has(p)) {
30
30
  return rxjs_1.of(true);
31
31
  }
32
- else if (this._filesToDelete.has(p)) {
32
+ if (this._filesToDelete.has(p)) {
33
33
  return rxjs_1.of(false);
34
34
  }
35
- else if ([...this._filesToRename.values()].some(([from]) => from == p)) {
36
- return rxjs_1.of(false);
37
- }
38
- else {
39
- return this._host.exists(p);
35
+ for (const [from, to] of this._filesToRename.values()) {
36
+ switch (p) {
37
+ case from:
38
+ return rxjs_1.of(false);
39
+ case to:
40
+ return rxjs_1.of(true);
41
+ }
40
42
  }
43
+ return this._host.exists(p);
41
44
  }
42
45
  _overwriteFile(path, content) {
43
46
  this._filesToUpdate.set(path, new update_buffer_1.UpdateBuffer(content));