@next-core/brick-utils 2.51.17 → 2.51.18

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
@@ -20312,13 +20312,6 @@ function removeDeadConditionsByAst(ast, options) {
20312
20312
 
20313
20313
  // Then, we remove dead conditions accordingly.
20314
20314
  traverse(ast, node => {
20315
- // let conditionalNodes: ConditionalStoryboardNode[];
20316
- // let rawContainer: any;
20317
- // let rawKey: string;
20318
- // let deleteEmptyArray = false;
20319
- // let isUseBrickEntry = false;
20320
- // let keepConditionalHandlers = false;
20321
-
20322
20315
  switch (node.type) {
20323
20316
  case "Root":
20324
20317
  shakeConditionalNodes(node.routes, node.raw, "routes");
@@ -20335,8 +20328,7 @@ function removeDeadConditionsByAst(ast, options) {
20335
20328
  case "SimpleLifeCycle":
20336
20329
  case "ConditionalEvent":
20337
20330
  shakeConditionalNodes(node.handlers, node.rawContainer, node.rawKey, {
20338
- deleteEmptyArray: true,
20339
- keepConditionalHandlers: true
20331
+ deleteEmptyArray: true
20340
20332
  });
20341
20333
  break;
20342
20334
  case "ResolveLifeCycle":
@@ -20373,14 +20365,13 @@ function removeDeadConditionsByAst(ast, options) {
20373
20365
  function shakeConditionalNodes(conditionalNodes, rawContainer, rawKey) {
20374
20366
  var {
20375
20367
  deleteEmptyArray,
20376
- isUseBrickEntry,
20377
- keepConditionalHandlers
20368
+ isUseBrickEntry
20378
20369
  } = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
20379
20370
  var removedNodes = [];
20380
20371
  if (Array.isArray(conditionalNodes)) {
20381
20372
  for (var node of conditionalNodes) {
20382
20373
  var _else;
20383
- if (keepConditionalHandlers && (_else = node.else) !== null && _else !== void 0 && _else.length) {
20374
+ if ((_else = node.else) !== null && _else !== void 0 && _else.length) {
20384
20375
  switch (node.raw.if) {
20385
20376
  case false:
20386
20377
  node.then = node.else;