@angular-devkit/core 20.0.0-next.2 → 20.0.0-next.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-devkit/core",
|
|
3
|
-
"version": "20.0.0-next.
|
|
3
|
+
"version": "20.0.0-next.4",
|
|
4
4
|
"description": "Angular DevKit - Core Utility Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"typings": "src/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
},
|
|
52
52
|
"packageManager": "pnpm@9.15.6",
|
|
53
53
|
"engines": {
|
|
54
|
-
"node": "^20.11.1 || >=22.
|
|
54
|
+
"node": "^20.11.1 || >=22.11.0",
|
|
55
55
|
"npm": "^6.11.0 || ^7.5.6 || >=8.0.0",
|
|
56
56
|
"yarn": ">= 1.13.0"
|
|
57
57
|
},
|
|
@@ -8,4 +8,5 @@
|
|
|
8
8
|
import { JsonValue } from '../utils';
|
|
9
9
|
import { JsonPointer } from './interface';
|
|
10
10
|
import { JsonSchema } from './schema';
|
|
11
|
+
export declare function addUndefinedObjectDefaults(value: JsonValue, _pointer: JsonPointer, schema?: JsonSchema): JsonValue;
|
|
11
12
|
export declare function addUndefinedDefaults(value: JsonValue, _pointer: JsonPointer, schema?: JsonSchema): JsonValue;
|
|
@@ -7,10 +7,17 @@
|
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.addUndefinedObjectDefaults = addUndefinedObjectDefaults;
|
|
10
11
|
exports.addUndefinedDefaults = addUndefinedDefaults;
|
|
11
12
|
const utils_1 = require("../utils");
|
|
12
13
|
const utility_1 = require("./utility");
|
|
14
|
+
function addUndefinedObjectDefaults(value, _pointer, schema) {
|
|
15
|
+
return transformUndefined(value, _pointer, schema, true);
|
|
16
|
+
}
|
|
13
17
|
function addUndefinedDefaults(value, _pointer, schema) {
|
|
18
|
+
return transformUndefined(value, _pointer, schema, false);
|
|
19
|
+
}
|
|
20
|
+
function transformUndefined(value, _pointer, schema, onlyObjects) {
|
|
14
21
|
if (typeof schema === 'boolean' || schema === undefined) {
|
|
15
22
|
return value;
|
|
16
23
|
}
|
|
@@ -40,7 +47,7 @@ function addUndefinedDefaults(value, _pointer, schema) {
|
|
|
40
47
|
// anything else needs to be checked by the consumer anyway
|
|
41
48
|
return value;
|
|
42
49
|
}
|
|
43
|
-
if (type === 'array') {
|
|
50
|
+
if (!onlyObjects && type === 'array') {
|
|
44
51
|
return value == undefined ? [] : value;
|
|
45
52
|
}
|
|
46
53
|
if (type === 'object') {
|
|
@@ -83,7 +90,7 @@ function addUndefinedDefaults(value, _pointer, schema) {
|
|
|
83
90
|
return false;
|
|
84
91
|
});
|
|
85
92
|
if (adjustedSchema && (0, utils_1.isJsonObject)(adjustedSchema)) {
|
|
86
|
-
newValue[propName] =
|
|
93
|
+
newValue[propName] = transformUndefined(value, _pointer, adjustedSchema, onlyObjects);
|
|
87
94
|
}
|
|
88
95
|
}
|
|
89
96
|
}
|