@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.esm.js CHANGED
@@ -1011,7 +1011,7 @@ function sanitize(cooked) {
1011
1011
  throw new TypeError("Cannot access reserved objects such as `Function`.");
1012
1012
  }
1013
1013
  }
1014
- var allowedConstructors = new WeakSet([Array, Map, Set, URLSearchParams, WeakMap, WeakSet, RegExp]);
1014
+ var allowedConstructors = new WeakSet([Array, Map, Set, URL, URLSearchParams, WeakMap, WeakSet, RegExp]);
1015
1015
  function isAllowedConstructor(constructor) {
1016
1016
  // `Date` maybe mocked when running tests for storyboard functions.
1017
1017
  return allowedConstructors.has(constructor) || constructor === Date;
@@ -20115,12 +20115,12 @@ var jsonFieldsInBrick = ["properties", "events", "lifeCycle", "params", "if", "t
20115
20115
  var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"];
20116
20116
 
20117
20117
  // Fields started with `_` will be removed by default.
20118
- var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "lock", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
20118
+ 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"];
20119
20119
  var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type");
20120
20120
 
20121
20121
  // Those fields can be disposed if value is null.
20122
20122
  var disposableNullFields = ["alias", "documentId", "context", "exports", "ref", "analyticsData"];
20123
- var disposableFalseOrNullFields = ["hybrid", "bg", "portal", "public", "exact"];
20123
+ var disposableFalseOrNullFields = ["hybrid", "bg", "portal", "public", "exact", "incrementalSubRoutes"];
20124
20124
  function normalizeBuilderNode(node) {
20125
20125
  if (isBrickNode(node)) {
20126
20126
  return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, "brick");
@@ -20131,6 +20131,7 @@ function normalizeBuilderNode(node) {
20131
20131
  return null;
20132
20132
  }
20133
20133
  function normalize(node, fieldsToRemove, jsonFields, yamlFields, type) {
20134
+ var temp;
20134
20135
  return Object.fromEntries(Object.entries(node)
20135
20136
  // Remove unused fields from CMDB.
20136
20137
  // Consider fields started with `_` as unused.
@@ -20141,7 +20142,10 @@ function normalize(node, fieldsToRemove, jsonFields, yamlFields, type) {
20141
20142
  // Parse specific fields.
20142
20143
  .map(_ref2 => {
20143
20144
  var [key, value] = _ref2;
20144
- return [key === "instanceId" ? "iid" : key, type === "route" && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? safeJsonParse(value) : yamlFields.includes(key) ? safeYamlParse(value) : cloneDeep(value)];
20145
+ return [key === "instanceId" ? "iid" : key, type === "route" && key === "segues" ? getCleanSegues(value) : jsonFields.includes(key) ? (temp = safeJsonParse(value),
20146
+ // There is a bug to cause json fields in route to be stored as `""` when it's empty.
20147
+ // These `""` can be safely ignored.
20148
+ temp === "" && type === "route" ? undefined : temp) : yamlFields.includes(key) ? safeYamlParse(value) : cloneDeep(value)];
20145
20149
  }));
20146
20150
  }
20147
20151
 
@@ -20596,7 +20600,7 @@ var shouldOmitInLodash = new Set([
20596
20600
 
20597
20601
  // Omit all mutable methods from moment.
20598
20602
  var shouldOmitInMoment = new Set(["lang", "langData", "locale", "localeData", "defineLocale", "updateLocale", "updateOffset"]);
20599
- 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"]);
20603
+ 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"]);
20600
20604
  function supplyIndividual(variableName, mock) {
20601
20605
  switch (variableName) {
20602
20606
  case "Object":