@next-core/brick-utils 2.52.6 → 2.52.8
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/dist/index.bundle.js +9 -5
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +9 -5
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.bundle.js
CHANGED
|
@@ -1017,7 +1017,7 @@
|
|
|
1017
1017
|
throw new TypeError("Cannot access reserved objects such as `Function`.");
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
var allowedConstructors = new WeakSet([Array, Map, Set, URLSearchParams, WeakMap, WeakSet, RegExp]);
|
|
1020
|
+
var allowedConstructors = new WeakSet([Array, Map, Set, URL, URLSearchParams, WeakMap, WeakSet, RegExp]);
|
|
1021
1021
|
function isAllowedConstructor(constructor) {
|
|
1022
1022
|
// `Date` maybe mocked when running tests for storyboard functions.
|
|
1023
1023
|
return allowedConstructors.has(constructor) || constructor === Date;
|
|
@@ -20121,12 +20121,12 @@
|
|
|
20121
20121
|
var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"];
|
|
20122
20122
|
|
|
20123
20123
|
// Fields started with `_` will be removed by default.
|
|
20124
|
-
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "lock", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20124
|
+
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "lock", "urlQueryParams", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20125
20125
|
var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type");
|
|
20126
20126
|
|
|
20127
20127
|
// Those fields can be disposed if value is null.
|
|
20128
20128
|
var disposableNullFields = ["alias", "documentId", "context", "exports", "ref", "analyticsData"];
|
|
20129
|
-
var disposableFalseOrNullFields = ["hybrid", "bg", "portal", "public", "exact"];
|
|
20129
|
+
var disposableFalseOrNullFields = ["hybrid", "bg", "portal", "public", "exact", "incrementalSubRoutes"];
|
|
20130
20130
|
function normalizeBuilderNode(node) {
|
|
20131
20131
|
if (isBrickNode(node)) {
|
|
20132
20132
|
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, "brick");
|
|
@@ -20137,6 +20137,7 @@
|
|
|
20137
20137
|
return null;
|
|
20138
20138
|
}
|
|
20139
20139
|
function normalize(node, fieldsToRemove, jsonFields, yamlFields, type) {
|
|
20140
|
+
var temp;
|
|
20140
20141
|
return Object.fromEntries(Object.entries(node)
|
|
20141
20142
|
// Remove unused fields from CMDB.
|
|
20142
20143
|
// Consider fields started with `_` as unused.
|
|
@@ -20147,7 +20148,10 @@
|
|
|
20147
20148
|
// Parse specific fields.
|
|
20148
20149
|
.map(_ref2 => {
|
|
20149
20150
|
var [key, value] = _ref2;
|
|
20150
|
-
return [key === "instanceId" ? "iid" : key, type === "route" && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ?
|
|
20151
|
+
return [key === "instanceId" ? "iid" : key, type === "route" && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? (temp = safeJsonParse(value),
|
|
20152
|
+
// There is a bug to cause json fields in route to be stored as `""` when it's empty.
|
|
20153
|
+
// These `""` can be safely ignored.
|
|
20154
|
+
temp === "" && type === "route" ? undefined : temp) : yamlFields.includes(key) ? safeYamlParse(value) : lodash.cloneDeep(value)];
|
|
20151
20155
|
}));
|
|
20152
20156
|
}
|
|
20153
20157
|
|
|
@@ -20602,7 +20606,7 @@
|
|
|
20602
20606
|
|
|
20603
20607
|
// Omit all mutable methods from moment.
|
|
20604
20608
|
var shouldOmitInMoment = new Set(["lang", "langData", "locale", "localeData", "defineLocale", "updateLocale", "updateOffset"]);
|
|
20605
|
-
var allowedGlobalObjects = new Set(["Array", "Boolean", "Date", "Infinity", "JSON", "Math", "NaN", "Number", "String", "RegExp", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "isFinite", "isNaN", "parseFloat", "parseInt", "Map", "Set", "URLSearchParams", "WeakMap", "WeakSet", "atob", "btoa"]);
|
|
20609
|
+
var allowedGlobalObjects = new Set(["Array", "Boolean", "Date", "Infinity", "JSON", "Math", "NaN", "Number", "String", "RegExp", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "isFinite", "isNaN", "parseFloat", "parseInt", "Map", "Set", "URL", "URLSearchParams", "WeakMap", "WeakSet", "atob", "btoa"]);
|
|
20606
20610
|
function supplyIndividual(variableName, mock) {
|
|
20607
20611
|
switch (variableName) {
|
|
20608
20612
|
case "Object":
|