@next-core/brick-utils 2.34.0 → 2.34.1

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
@@ -21429,14 +21429,14 @@ var {
21429
21429
  convertUnitValueByPrecision: convertValueByPrecision
21430
21430
  } = utils;
21431
21431
 
21432
- var CTX = "CTX";
21433
21432
  function resolveContextConcurrently(_x, _x2) {
21434
21433
  return _resolveContextConcurrently.apply(this, arguments);
21435
21434
  }
21436
21435
 
21437
21436
  function _resolveContextConcurrently() {
21438
21437
  _resolveContextConcurrently = _asyncToGenerator(function* (contextConfs, resolveContext) {
21439
- var dependencyMap = getDependencyMapOfContext(contextConfs);
21438
+ var keyword = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "CTX";
21439
+ var dependencyMap = getDependencyMapOfContext(contextConfs, keyword);
21440
21440
  var pendingDeps = new Set(Array.from(dependencyMap.keys()).map(contextConf => contextConf.name));
21441
21441
  var includesComputed = Array.from(dependencyMap.values()).some(stats => stats.includesComputed);
21442
21442
  var processed = new WeakSet();
@@ -21484,7 +21484,7 @@ function _resolveContextConcurrently() {
21484
21484
 
21485
21485
  if (dependencyMap.size > 0) {
21486
21486
  // This will throw if circular contexts detected.
21487
- detectCircularContexts(dependencyMap);
21487
+ detectCircularContexts(dependencyMap, keyword);
21488
21488
  scheduleAsSerial = true;
21489
21489
  yield scheduleNext();
21490
21490
  }
@@ -21493,7 +21493,8 @@ function _resolveContextConcurrently() {
21493
21493
  }
21494
21494
 
21495
21495
  function syncResolveContextConcurrently(contextConfs, resolveContext) {
21496
- var dependencyMap = getDependencyMapOfContext(contextConfs);
21496
+ var keyword = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "CTX";
21497
+ var dependencyMap = getDependencyMapOfContext(contextConfs, keyword);
21497
21498
  var pendingDeps = new Set(Array.from(dependencyMap.keys()).map(contextConf => contextConf.name));
21498
21499
  var includesComputed = Array.from(dependencyMap.values()).some(stats => stats.includesComputed);
21499
21500
  var scheduleAsSerial = includesComputed;
@@ -21525,7 +21526,7 @@ function syncResolveContextConcurrently(contextConfs, resolveContext) {
21525
21526
 
21526
21527
  if (dependencyMap.size > 0) {
21527
21528
  // This will throw if circular contexts detected.
21528
- detectCircularContexts(dependencyMap);
21529
+ detectCircularContexts(dependencyMap, keyword);
21529
21530
  scheduleAsSerial = true;
21530
21531
  scheduleNext();
21531
21532
  }
@@ -21539,6 +21540,7 @@ function predicateNextResolveFactory(pendingDeps, scheduleAsSerial) {
21539
21540
  }
21540
21541
 
21541
21542
  function getDependencyMapOfContext(contextConfs) {
21543
+ var keyword = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "CTX";
21542
21544
  var depsMap = new Map();
21543
21545
 
21544
21546
  for (var _contextConf2 of contextConfs) {
@@ -21548,7 +21550,7 @@ function getDependencyMapOfContext(contextConfs) {
21548
21550
  };
21549
21551
 
21550
21552
  if (!_contextConf2.property) {
21551
- visitStoryboardExpressions([_contextConf2.if, _contextConf2.value, _contextConf2.resolve], beforeVisitContextFactory(stats), CTX);
21553
+ visitStoryboardExpressions([_contextConf2.if, _contextConf2.value, _contextConf2.resolve], beforeVisitContextFactory(stats, keyword), keyword);
21552
21554
  }
21553
21555
 
21554
21556
  depsMap.set(_contextConf2, stats);
@@ -21557,9 +21559,9 @@ function getDependencyMapOfContext(contextConfs) {
21557
21559
  return depsMap;
21558
21560
  }
21559
21561
 
21560
- function beforeVisitContextFactory(stats) {
21562
+ function beforeVisitContextFactory(stats, keyword) {
21561
21563
  return function beforeVisitContext(node, parent) {
21562
- if (node.name === CTX) {
21564
+ if (node.name === keyword) {
21563
21565
  var memberParent = parent[parent.length - 1];
21564
21566
 
21565
21567
  if ((memberParent === null || memberParent === void 0 ? void 0 : memberParent.node.type) === "MemberExpression" && memberParent.key === "object") {
@@ -21582,7 +21584,7 @@ function beforeVisitContextFactory(stats) {
21582
21584
  };
21583
21585
  }
21584
21586
 
21585
- function detectCircularContexts(dependencyMap) {
21587
+ function detectCircularContexts(dependencyMap, keyword) {
21586
21588
  var duplicatedMap = new Map(dependencyMap);
21587
21589
  var pendingDeps = new Set(Array.from(duplicatedMap.keys()).map(contextConf => contextConf.name));
21588
21590
 
@@ -21605,7 +21607,7 @@ function detectCircularContexts(dependencyMap) {
21605
21607
  next();
21606
21608
 
21607
21609
  if (duplicatedMap.size > 0) {
21608
- throw new ReferenceError("Circular CTX detected: ".concat(Array.from(duplicatedMap.keys()).map(contextConf => contextConf.name).join(", ")));
21610
+ throw new ReferenceError("Circular ".concat(keyword, " detected: ").concat(Array.from(duplicatedMap.keys()).map(contextConf => contextConf.name).join(", ")));
21609
21611
  }
21610
21612
  }
21611
21613