@angular-devkit/core 10.1.0-rc.0 → 10.1.3

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/core",
3
- "version": "10.1.0-rc.0",
3
+ "version": "10.1.3",
4
4
  "description": "Angular DevKit - Core Utility Library",
5
5
  "main": "src/index.js",
6
6
  "typings": "src/index.d.ts",
@@ -16,7 +16,8 @@ export * from './noop';
16
16
  *
17
17
  * These cannot be in their respective schema.json file because we either change the type
18
18
  * (e.g. --buildEventLog is string, but we want to know the usage of it, not its value), or
19
- * some validation needs to be done (we cannot record ng add --collection if it's not whitelisted).
19
+ * some validation needs to be done (we cannot record ng add --collection if it's not marked as
20
+ * allowed).
20
21
  */
21
22
  export declare enum NgCliAnalyticsDimensions {
22
23
  CpuCount = 1,
@@ -29,7 +29,8 @@ __exportStar(require("./noop"), exports);
29
29
  *
30
30
  * These cannot be in their respective schema.json file because we either change the type
31
31
  * (e.g. --buildEventLog is string, but we want to know the usage of it, not its value), or
32
- * some validation needs to be done (we cannot record ng add --collection if it's not whitelisted).
32
+ * some validation needs to be done (we cannot record ng add --collection if it's not marked as
33
+ * allowed).
33
34
  */
34
35
  var NgCliAnalyticsDimensions;
35
36
  (function (NgCliAnalyticsDimensions) {
@@ -0,0 +1,13 @@
1
+ {
2
+ "version": 1,
3
+ // Comment
4
+ "schematics": {
5
+ "@angular/schematics:component": {
6
+ "prefix": "abc"
7
+ }
8
+ },
9
+ "x-foo": {
10
+ "is": ["good", "great", "awesome"]
11
+ },
12
+ "x-bar": 5,
13
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "version": 1,
3
+ // Comment
4
+ "x-foo": {
5
+ "is": ["good", "great", "awesome"]
6
+ },
7
+ "x-bar": 5,
8
+ }
@@ -126,6 +126,11 @@ function create(ast, path, reporter, excluded = new Set(), included, base) {
126
126
  return value;
127
127
  },
128
128
  set(target, p, value) {
129
+ if (value === undefined) {
130
+ // setting to undefined is equivalent to a delete
131
+ // tslint:disable-next-line: no-non-null-assertion
132
+ return this.deleteProperty(target, p);
133
+ }
129
134
  if (typeof p === 'symbol' || Reflect.has(target, p)) {
130
135
  return Reflect.set(target, p, value);
131
136
  }
@@ -169,14 +174,26 @@ function create(ast, path, reporter, excluded = new Set(), included, base) {
169
174
  if (cacheEntry.node) {
170
175
  alteredNodes.add(cacheEntry.node);
171
176
  }
172
- reporter(propertyPath, cacheEntry.parent, cacheEntry.node, oldValue, undefined);
177
+ if (cacheEntry.parent.kind === 'keyvalue') {
178
+ // Remove the entire key/value pair from this JSON object
179
+ reporter(propertyPath, ast, cacheEntry.node, oldValue, undefined);
180
+ }
181
+ else {
182
+ reporter(propertyPath, cacheEntry.parent, cacheEntry.node, oldValue, undefined);
183
+ }
173
184
  }
174
185
  else {
175
186
  const { node, parent } = findNode(ast, p);
176
187
  if (node) {
177
188
  cache.set(propertyPath, { node, parent, value: undefined });
178
189
  alteredNodes.add(node);
179
- reporter(propertyPath, parent, node, node && node.value, undefined);
190
+ if (parent.kind === 'keyvalue') {
191
+ // Remove the entire key/value pair from this JSON object
192
+ reporter(propertyPath, ast, node, node && node.value, undefined);
193
+ }
194
+ else {
195
+ reporter(propertyPath, parent, node, node && node.value, undefined);
196
+ }
180
197
  }
181
198
  }
182
199
  return true;