@angular-devkit/schematics 12.0.0 → 12.0.4

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/README.md CHANGED
@@ -114,19 +114,19 @@ The system operates on placeholders defined inside files or their paths as loade
114
114
 
115
115
  ## Path Templating
116
116
 
117
- | Placeholder | Description |
118
- | --------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
119
- | **variable** | Replaced with the value of `variable`. |
120
- | **variable@function** | Replaced with the result of the call `function(variable)`. Can be chained to the left (`__variable@function1@function2__ ` etc). |
117
+ | Placeholder | Description |
118
+ | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
119
+ | `__variable__` | Replaced with the value of `variable`. |
120
+ | `__variable@function__` | Replaced with the result of the call `function(variable)`. Can be chained to the left (`__variable@function1@function2__ ` etc). |
121
121
 
122
122
  ## Content Templating
123
123
 
124
- | Placeholder | Description |
125
- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
126
- | <%= expression %> | Replaced with the result of the call of the given expression. This only supports direct expressions, no structural (for/if/...) JavaScript. |
127
- | <%- expression %> | Same as above, but the value of the result will be escaped for HTML when inserted (i.e. replacing '<' with '&lt;') |
128
- | <% inline code %> | Inserts the given code into the template structure, allowing to insert structural JavaScript. |
129
- | <%# text %> | A comment, which gets entirely dropped. |
124
+ | Placeholder | Description |
125
+ | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
126
+ | `<%= expression %>` | Replaced with the result of the call of the given expression. This only supports direct expressions, no structural (for/if/...) JavaScript. |
127
+ | `<%- expression %>` | Same as above, but the value of the result will be escaped for HTML when inserted (i.e. replacing '<' with '&lt;') |
128
+ | `<% inline code %>` | Inserts the given code into the template structure, allowing to insert structural JavaScript. |
129
+ | `<%# text %>` | A comment, which gets entirely dropped. |
130
130
 
131
131
  # Examples
132
132
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-devkit/schematics",
3
- "version": "12.0.0",
3
+ "version": "12.0.4",
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.0",
21
+ "@angular-devkit/core": "12.0.4",
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));