@next-core/brick-utils 2.51.1 → 2.51.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/dist/index.esm.js
CHANGED
|
@@ -20025,11 +20025,12 @@ var jsonFieldsInBrick = ["properties", "events", "lifeCycle", "params", "if", "t
|
|
|
20025
20025
|
var yamlFieldsInBrick = ["permissionsPreCheck", "transformFrom"];
|
|
20026
20026
|
|
|
20027
20027
|
// Fields started with `_` will be removed by default.
|
|
20028
|
-
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20029
|
-
var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type"
|
|
20028
|
+
var fieldsToRemoveInRoute = ["appId", "children", "creator", "ctime", "id", "graphInfo", "modifier", "mountPoint", "mtime", "org", "parent", "sort", "name", "providersBak", "providers_bak", "previewSettings", "screenshot", "lock", "deleteAuthorizers", "readAuthorizers", "updateAuthorizers"];
|
|
20029
|
+
var fieldsToRemoveInBrick = fieldsToRemoveInRoute.concat("type");
|
|
20030
20030
|
|
|
20031
20031
|
// Those fields can be disposed if value is null.
|
|
20032
|
-
var disposableNullFields = ["alias", "documentId", "
|
|
20032
|
+
var disposableNullFields = ["alias", "documentId", "context", "exports", "ref", "analyticsData"];
|
|
20033
|
+
var disposableFalseOrNullFields = ["hybrid", "bg", "portal", "public", "exact"];
|
|
20033
20034
|
function normalizeBuilderNode(node) {
|
|
20034
20035
|
if (isBrickNode(node)) {
|
|
20035
20036
|
return normalize(node, fieldsToRemoveInBrick, jsonFieldsInBrick, yamlFieldsInBrick, "brick");
|
|
@@ -20045,7 +20046,7 @@ function normalize(node, fieldsToRemove, jsonFields, yamlFields, type) {
|
|
|
20045
20046
|
// Consider fields started with `_` as unused.
|
|
20046
20047
|
.filter(_ref => {
|
|
20047
20048
|
var [key, value] = _ref;
|
|
20048
|
-
return !(key[0] === "_" || fieldsToRemove.includes(key) || value === null && disposableNullFields.includes(key));
|
|
20049
|
+
return !(key[0] === "_" || fieldsToRemove.includes(key) || (value === false || value === null) && disposableFalseOrNullFields.includes(key) || value === null && disposableNullFields.includes(key) || value === true && key === "injectDeep");
|
|
20049
20050
|
})
|
|
20050
20051
|
// Parse specific fields.
|
|
20051
20052
|
.map(_ref2 => {
|
|
@@ -20359,7 +20360,7 @@ function removeDeadConditionsInTpl(tplConstructor, options) {
|
|
|
20359
20360
|
}
|
|
20360
20361
|
function computeConstantCondition(ifContainer) {
|
|
20361
20362
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
20362
|
-
if (hasOwnProperty$1(ifContainer, "if")) {
|
|
20363
|
+
if (hasOwnProperty$1(ifContainer, "if") && ifContainer.if !== undefined) {
|
|
20363
20364
|
if (typeof ifContainer.if === "string" && isEvaluable(ifContainer.if)) {
|
|
20364
20365
|
try {
|
|
20365
20366
|
var {
|