@next-core/brick-utils 2.28.10 → 2.28.11
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/CHANGELOG.md +11 -0
- package/dist/index.bundle.js +7 -13
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +7 -13
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [2.28.11](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.10...@next-core/brick-utils@2.28.11) (2021-10-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* dispose specific null fields ([0f50281](https://github.com/easyops-cn/next-core/commit/0f502815abf47faf4156bfbf91029125bbda01a4))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [2.28.10](https://github.com/easyops-cn/next-core/compare/@next-core/brick-utils@2.28.9...@next-core/brick-utils@2.28.10) (2021-10-21)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @next-core/brick-utils
|
package/dist/index.bundle.js
CHANGED
|
@@ -20411,32 +20411,26 @@
|
|
|
20411
20411
|
|
|
20412
20412
|
var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"]; // Fields started with `_` will be removed by default.
|
|
20413
20413
|
|
|
20414
|
-
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "instanceId", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20415
|
-
var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type");
|
|
20414
|
+
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "instanceId", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20415
|
+
var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type", "alias"); // Those fields can be disposed if value is null.
|
|
20416
|
+
|
|
20417
|
+
var disposableNullFields = ["alias", "documentId", "hybrid", "bg", "context", "exports", "ref", "portal"];
|
|
20416
20418
|
function normalizeBuilderNode(node) {
|
|
20417
20419
|
if (isBrickNode(node)) {
|
|
20418
|
-
return
|
|
20420
|
+
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, false);
|
|
20419
20421
|
}
|
|
20420
20422
|
|
|
20421
20423
|
if (isRouteNode(node)) {
|
|
20422
|
-
return
|
|
20424
|
+
return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute, true);
|
|
20423
20425
|
}
|
|
20424
20426
|
|
|
20425
20427
|
return null;
|
|
20426
20428
|
}
|
|
20427
20429
|
|
|
20428
|
-
function normalizeBuilderBrickNode(node) {
|
|
20429
|
-
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick);
|
|
20430
|
-
}
|
|
20431
|
-
|
|
20432
|
-
function normalizeBuilderRouteNode(node) {
|
|
20433
|
-
return normalize(node, fieldsToRemoveInRoute, jsonFieldsInRoute, yamlFieldsInRoute, true);
|
|
20434
|
-
}
|
|
20435
|
-
|
|
20436
20430
|
function normalize(node, fieldsToRemove, jsonFields, yamlFields, cleanUpSegues) {
|
|
20437
20431
|
return Object.fromEntries(Object.entries(node) // Remove unused fields from CMDB.
|
|
20438
20432
|
// Consider fields started with `_` as unused.
|
|
20439
|
-
.filter(([key]) => key[0]
|
|
20433
|
+
.filter(([key, value]) => !(key[0] === "_" || fieldsToRemove.includes(key) || value === null && disposableNullFields.includes(key))) // Parse specific fields.
|
|
20440
20434
|
.map(([key, value]) => [key, cleanUpSegues && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : lodash.cloneDeep(value)]));
|
|
20441
20435
|
} // Clear `segue._view` which is for development only.
|
|
20442
20436
|
|