@player-ui/common-expressions-plugin 0.13.0 → 0.14.0-next.0

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.
@@ -1462,22 +1462,6 @@ var CommonExpressionsPlugin = function() {
1462
1462
  }
1463
1463
  });
1464
1464
  };
1465
- var unpackNode = function unpackNode(item) {
1466
- var _item_children_, _item_children, _item_children_1, _item_children1;
1467
- var unpacked = [];
1468
- if ("children" in item && ((_item_children = item.children) === null || _item_children === void 0 ? void 0 : (_item_children_ = _item_children[0]) === null || _item_children_ === void 0 ? void 0 : _item_children_.value.type) === "asset" && ((_item_children1 = item.children) === null || _item_children1 === void 0 ? void 0 : (_item_children_1 = _item_children1[0]) === null || _item_children_1 === void 0 ? void 0 : _item_children_1.value).children) {
1469
- var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
1470
- if (((_item_children__value_children = ((_item_children2 = item.children) === null || _item_children2 === void 0 ? void 0 : (_item_children_2 = _item_children2[0]) === null || _item_children_2 === void 0 ? void 0 : _item_children_2.value).children) === null || _item_children__value_children === void 0 ? void 0 : (_item_children__value_children_ = _item_children__value_children[0]) === null || _item_children__value_children_ === void 0 ? void 0 : _item_children__value_children_.value.type) === "multi-node") {
1471
- var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
1472
- ((_item_children__value_children1 = ((_item_children3 = item.children) === null || _item_children3 === void 0 ? void 0 : (_item_children_3 = _item_children3[0]) === null || _item_children_3 === void 0 ? void 0 : _item_children_3.value).children) === null || _item_children__value_children1 === void 0 ? void 0 : (_item_children__value_children_1 = _item_children__value_children1[0]) === null || _item_children__value_children_1 === void 0 ? void 0 : _item_children__value_children_1.value).values.forEach(function(value) {
1473
- unpacked.push(value);
1474
- });
1475
- }
1476
- } else {
1477
- unpacked.push(item);
1478
- }
1479
- return unpacked;
1480
- };
1481
1465
  var hasSomethingToResolve = function hasSomethingToResolve(str) {
1482
1466
  return bindingResolveLookup(str) || expressionResolveLookup(str);
1483
1467
  };
@@ -2852,6 +2836,7 @@ var CommonExpressionsPlugin = function() {
2852
2836
  }
2853
2837
  };
2854
2838
  var identifier = function() {
2839
+ var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
2855
2840
  if (!isIdentifierChar(ch)) {
2856
2841
  return;
2857
2842
  }
@@ -2862,6 +2847,14 @@ var CommonExpressionsPlugin = function() {
2862
2847
  }
2863
2848
  value += ch;
2864
2849
  }
2850
+ if (allowBoolValue) {
2851
+ if (value === "true") {
2852
+ return toValue(true);
2853
+ }
2854
+ if (value === "false") {
2855
+ return toValue(false);
2856
+ }
2857
+ }
2865
2858
  if (value) {
2866
2859
  var maybeNumber = Number(value);
2867
2860
  value = isNaN(maybeNumber) ? value : maybeNumber;
@@ -2910,8 +2903,9 @@ var CommonExpressionsPlugin = function() {
2910
2903
  }
2911
2904
  };
2912
2905
  var simpleSegment = function() {
2906
+ var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
2913
2907
  var _nestedPath, _ref;
2914
- return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier();
2908
+ return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
2915
2909
  };
2916
2910
  var segment = function() {
2917
2911
  var segments = [];
@@ -2926,6 +2920,7 @@ var CommonExpressionsPlugin = function() {
2926
2920
  return toConcatenatedNode(segments);
2927
2921
  };
2928
2922
  var optionallyQuotedSegment = function() {
2923
+ var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
2929
2924
  whitespace();
2930
2925
  if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
2931
2926
  var singleQuote = ch === SINGLE_QUOTE;
@@ -2934,7 +2929,7 @@ var CommonExpressionsPlugin = function() {
2934
2929
  next(singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE);
2935
2930
  return id;
2936
2931
  }
2937
- return simpleSegment();
2932
+ return simpleSegment(allowBoolValue);
2938
2933
  };
2939
2934
  var equals = function() {
2940
2935
  if (ch !== EQUALS) {
@@ -2954,7 +2949,7 @@ var CommonExpressionsPlugin = function() {
2954
2949
  whitespace();
2955
2950
  if (equals()) {
2956
2951
  whitespace();
2957
- var second = optionallyQuotedSegment();
2952
+ var second = optionallyQuotedSegment(true);
2958
2953
  value = toQuery(value, second);
2959
2954
  whitespace();
2960
2955
  }
@@ -3142,7 +3137,7 @@ var CommonExpressionsPlugin = function() {
3142
3137
  appendPathSegments(getValueForNode(resolvedNode));
3143
3138
  break;
3144
3139
  case "Value":
3145
- appendPathSegments(resolvedNode.value);
3140
+ appendPathSegments(typeof resolvedNode.value === "boolean" ? String(resolvedNode.value) : resolvedNode.value);
3146
3141
  break;
3147
3142
  case "Query":
3148
3143
  {
@@ -4709,23 +4704,8 @@ var CommonExpressionsPlugin = function() {
4709
4704
  function Parser() {
4710
4705
  _class_call_check(this, Parser);
4711
4706
  this.hooks = {
4712
- /**
4713
- * A hook to interact with an object _before_ parsing it into an AST
4714
- *
4715
- * @param value - The object we're are about to parse
4716
- * @returns - A new value to parse.
4717
- * If undefined, the original value is used.
4718
- * If null, we stop parsing this node.
4719
- */ onParseObject: new SyncWaterfallHook(),
4720
- /**
4721
- * A callback to interact with an AST _after_ we parse it into the AST
4722
- *
4723
- * @param value - The object we parsed
4724
- * @param node - The AST node we generated
4725
- * @returns - A new AST node to use
4726
- * If undefined, the original value is used.
4727
- * If null, we ignore this node all together
4728
- */ onCreateASTNode: new SyncWaterfallHook(),
4707
+ onParseObject: new SyncWaterfallHook(),
4708
+ onCreateASTNode: new SyncWaterfallHook(),
4729
4709
  parseNode: new SyncBailHook()
4730
4710
  };
4731
4711
  }
@@ -4867,20 +4847,14 @@ var CommonExpressionsPlugin = function() {
4867
4847
  function Resolver(root, options) {
4868
4848
  _class_call_check(this, Resolver);
4869
4849
  this.hooks = {
4870
- /** A hook to allow skipping of the resolution tree for a specific node */ skipResolve: new SyncWaterfallHook(),
4871
- /** An event emitted before calculating the next update */ beforeUpdate: new SyncHook(),
4872
- /** An event emitted after calculating the next update */ afterUpdate: new SyncHook(),
4873
- /** The options passed to a node to resolve it to an object */ resolveOptions: new SyncWaterfallHook(),
4874
- /** A hook to transform the AST node into a new AST node before resolving it */ beforeResolve: new SyncWaterfallHook(),
4875
- /**
4876
- * A hook to transform an AST node into it's resolved value.
4877
- * This runs _before_ any children are resolved
4878
- */ resolve: new SyncWaterfallHook(),
4879
- /**
4880
- * A hook to transform the resolved value of an AST node.
4881
- * This runs _after_ all children nodes are resolved
4882
- */ afterResolve: new SyncWaterfallHook(),
4883
- /** Called at the very end of a node's tree being updated */ afterNodeUpdate: new SyncHook()
4850
+ skipResolve: new SyncWaterfallHook(),
4851
+ beforeUpdate: new SyncHook(),
4852
+ afterUpdate: new SyncHook(),
4853
+ resolveOptions: new SyncWaterfallHook(),
4854
+ beforeResolve: new SyncWaterfallHook(),
4855
+ resolve: new SyncWaterfallHook(),
4856
+ afterResolve: new SyncWaterfallHook(),
4857
+ afterNodeUpdate: new SyncHook()
4884
4858
  };
4885
4859
  this.root = root;
4886
4860
  this.options = options;
@@ -4888,6 +4862,7 @@ var CommonExpressionsPlugin = function() {
4888
4862
  this.ASTMap = /* @__PURE__ */ new Map();
4889
4863
  this.logger = options.logger;
4890
4864
  this.idCache = /* @__PURE__ */ new Set();
4865
+ this.AsyncIdMap = /* @__PURE__ */ new Map();
4891
4866
  }
4892
4867
  _create_class(Resolver, [
4893
4868
  {
@@ -4898,13 +4873,27 @@ var CommonExpressionsPlugin = function() {
4898
4873
  },
4899
4874
  {
4900
4875
  key: "update",
4901
- value: function update(changes) {
4876
+ value: function update(changes, asyncChanges) {
4877
+ var _this = this;
4902
4878
  this.hooks.beforeUpdate.call(changes);
4903
4879
  var resolveCache = /* @__PURE__ */ new Map();
4904
4880
  this.idCache.clear();
4905
4881
  var prevASTMap = new Map(this.ASTMap);
4906
4882
  this.ASTMap.clear();
4907
- var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap);
4883
+ var prevAsyncIdMap = new Map(this.AsyncIdMap);
4884
+ var nextAsyncIdMap = /* @__PURE__ */ new Map();
4885
+ asyncChanges === null || asyncChanges === void 0 ? void 0 : asyncChanges.forEach(function(id) {
4886
+ var current = prevAsyncIdMap.get(id);
4887
+ while(current && prevASTMap.has(current)){
4888
+ var next = prevASTMap.get(current);
4889
+ if (next && _this.resolveCache.has(next)) {
4890
+ _this.resolveCache.delete(next);
4891
+ }
4892
+ current = current.parent;
4893
+ }
4894
+ });
4895
+ var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, nextAsyncIdMap);
4896
+ this.AsyncIdMap = nextAsyncIdMap;
4908
4897
  this.resolveCache = resolveCache;
4909
4898
  this.hooks.afterUpdate.call(updated.value);
4910
4899
  return updated.value;
@@ -4958,9 +4947,8 @@ var CommonExpressionsPlugin = function() {
4958
4947
  },
4959
4948
  {
4960
4949
  key: "computeTree",
4961
- value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
4950
+ value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nextAsyncIdMap) {
4962
4951
  var _this = this;
4963
- var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
4964
4952
  var dependencyModel = new DependencyModel(options.data.model);
4965
4953
  dependencyModel.trackSubset("core");
4966
4954
  var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
@@ -4979,15 +4967,6 @@ var CommonExpressionsPlugin = function() {
4979
4967
  var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
4980
4968
  var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
4981
4969
  var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
4982
- var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
4983
- parent: partiallyResolvedParent
4984
- });
4985
- var _this_hooks_beforeResolve_call;
4986
- var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
4987
- type: "empty"
4988
- };
4989
- var isNestedMultiNodeWithAsync = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent === void 0 ? void 0 : (_partiallyResolvedParent_parent_parent = _partiallyResolvedParent_parent.parent) === null || _partiallyResolvedParent_parent_parent === void 0 ? void 0 : _partiallyResolvedParent_parent_parent.type) === "multi-node" && partiallyResolvedParent.parent.type === "value" && ((_resolvedAST_parent = resolvedAST.parent) === null || _resolvedAST_parent === void 0 ? void 0 : _resolvedAST_parent.type) === "asset" && resolvedAST.parent.value.id.includes("async");
4990
- var isNestedMultiNode = resolvedAST.type === "multi-node" && (partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : (_partiallyResolvedParent_parent1 = partiallyResolvedParent.parent) === null || _partiallyResolvedParent_parent1 === void 0 ? void 0 : _partiallyResolvedParent_parent1.type) === "multi-node" && partiallyResolvedParent.type === "value";
4991
4970
  if (previousResult && shouldUseLastValue) {
4992
4971
  var update2 = _object_spread_props(_object_spread({}, previousResult), {
4993
4972
  updated: false
@@ -4999,6 +4978,30 @@ var CommonExpressionsPlugin = function() {
4999
4978
  updated: false
5000
4979
  });
5001
4980
  cacheUpdate.set(AST, resolvedUpdate);
4981
+ if (resolvedUpdate.node.type === "async") {
4982
+ nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
4983
+ }
4984
+ var _resolvedUpdate_node_asyncNodesResolved;
4985
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4986
+ try {
4987
+ for(var _iterator = ((_resolvedUpdate_node_asyncNodesResolved = resolvedUpdate.node.asyncNodesResolved) !== null && _resolvedUpdate_node_asyncNodesResolved !== void 0 ? _resolvedUpdate_node_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
4988
+ var key = _step.value;
4989
+ nextAsyncIdMap.set(key, resolvedUpdate.node);
4990
+ }
4991
+ } catch (err) {
4992
+ _didIteratorError = true;
4993
+ _iteratorError = err;
4994
+ } finally{
4995
+ try {
4996
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4997
+ _iterator.return();
4998
+ }
4999
+ } finally{
5000
+ if (_didIteratorError) {
5001
+ throw _iteratorError;
5002
+ }
5003
+ }
5004
+ }
5002
5005
  var handleChildNode = function(childNode) {
5003
5006
  var _prevASTMap_get;
5004
5007
  var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
@@ -5021,10 +5024,37 @@ var CommonExpressionsPlugin = function() {
5021
5024
  repopulateASTMapFromCache(previousResult, node, rawParent);
5022
5025
  return update2;
5023
5026
  }
5024
- if (isNestedMultiNodeWithAsync) {
5025
- resolvedAST.parent = partiallyResolvedParent.parent;
5026
- } else {
5027
- resolvedAST.parent = partiallyResolvedParent;
5027
+ var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
5028
+ parent: partiallyResolvedParent
5029
+ });
5030
+ var _this_hooks_beforeResolve_call;
5031
+ var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
5032
+ type: "empty"
5033
+ };
5034
+ resolvedAST.parent = partiallyResolvedParent;
5035
+ if (resolvedAST.type === "async") {
5036
+ nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
5037
+ }
5038
+ var _resolvedAST_asyncNodesResolved;
5039
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5040
+ try {
5041
+ for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5042
+ var id = _step.value;
5043
+ nextAsyncIdMap.set(id, resolvedAST);
5044
+ }
5045
+ } catch (err) {
5046
+ _didIteratorError = true;
5047
+ _iteratorError = err;
5048
+ } finally{
5049
+ try {
5050
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5051
+ _iterator.return();
5052
+ }
5053
+ } finally{
5054
+ if (_didIteratorError) {
5055
+ throw _iteratorError;
5056
+ }
5057
+ }
5028
5058
  }
5029
5059
  resolveOptions.node = resolvedAST;
5030
5060
  this.ASTMap.set(resolvedAST, node);
@@ -5038,7 +5068,7 @@ var CommonExpressionsPlugin = function() {
5038
5068
  if ("children" in resolvedAST) {
5039
5069
  var _resolvedAST_children;
5040
5070
  var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
5041
- var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
5071
+ var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
5042
5072
  var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
5043
5073
  childTreeDeps.forEach(function(binding) {
5044
5074
  return childDependencies.add(binding);
@@ -5059,40 +5089,18 @@ var CommonExpressionsPlugin = function() {
5059
5089
  resolvedAST.children = newChildren;
5060
5090
  } else if (resolvedAST.type === "multi-node") {
5061
5091
  var childValue = [];
5062
- var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node;
5063
- var hasAsync = resolvedAST.values.map(function(value, index) {
5064
- return value.type === "async" ? index : -1;
5065
- }).filter(function(index) {
5066
- return index !== -1;
5067
- });
5068
- var newValues = resolvedAST.values.map(function(mValue) {
5069
- var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
5092
+ var rawParentToPassIn = node;
5093
+ resolvedAST.values = resolvedAST.values.map(function(mValue) {
5094
+ var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
5070
5095
  if (mTree.value !== void 0 && mTree.value !== null) {
5071
- if (mValue.type === "async" && mValue.flatten && mTree.value.asset && Array.isArray(mTree.value.asset.values)) {
5072
- unpackAndPush(mTree.value, childValue);
5073
- } else {
5074
- childValue.push(mTree.value);
5075
- }
5096
+ mTree.dependencies.forEach(function(bindingDep) {
5097
+ return childDependencies.add(bindingDep);
5098
+ });
5099
+ updated = updated || mTree.updated;
5100
+ childValue.push(mTree.value);
5076
5101
  }
5077
- mTree.dependencies.forEach(function(bindingDep) {
5078
- return childDependencies.add(bindingDep);
5079
- });
5080
- updated = updated || mTree.updated;
5081
5102
  return mTree.node;
5082
5103
  });
5083
- if (hasAsync.length > 0) {
5084
- var copy = newValues;
5085
- hasAsync.forEach(function(index) {
5086
- var _copy;
5087
- if (copy[index]) (_copy = copy).splice.apply(_copy, [
5088
- index,
5089
- 1
5090
- ].concat(_to_consumable_array(unpackNode(copy[index]))));
5091
- });
5092
- resolvedAST.values = copy;
5093
- } else {
5094
- resolvedAST.values = newValues;
5095
- }
5096
5104
  resolved = childValue;
5097
5105
  }
5098
5106
  childDependencies.forEach(function(bindingDep) {
@@ -5113,7 +5121,7 @@ var CommonExpressionsPlugin = function() {
5113
5121
  value: resolved,
5114
5122
  dependencies: /* @__PURE__ */ new Set(_to_consumable_array(dependencyModel.getDependencies()).concat(_to_consumable_array(childDependencies)))
5115
5123
  };
5116
- this.hooks.afterNodeUpdate.call(node, isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : rawParent, update);
5124
+ this.hooks.afterNodeUpdate.call(node, rawParent, update);
5117
5125
  cacheUpdate.set(node, update);
5118
5126
  return update;
5119
5127
  }
@@ -5121,15 +5129,6 @@ var CommonExpressionsPlugin = function() {
5121
5129
  ]);
5122
5130
  return Resolver;
5123
5131
  }();
5124
- function unpackAndPush(item, initial) {
5125
- if (item.asset.values && Array.isArray(item.asset.values)) {
5126
- item.asset.values.forEach(function(i) {
5127
- unpackAndPush(i, initial);
5128
- });
5129
- } else {
5130
- initial.push(item);
5131
- }
5132
- }
5133
5132
  var CrossfieldProvider = /*#__PURE__*/ function() {
5134
5133
  function CrossfieldProvider(initialView, parser, logger) {
5135
5134
  _class_call_check(this, CrossfieldProvider);
@@ -5197,9 +5196,11 @@ var CommonExpressionsPlugin = function() {
5197
5196
  _create_class(ViewInstance, [
5198
5197
  {
5199
5198
  key: "updateAsync",
5200
- value: function updateAsync() {
5199
+ value: function updateAsync(asyncNode) {
5201
5200
  var _this_resolver;
5202
- var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
5201
+ var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set([
5202
+ asyncNode
5203
+ ]));
5203
5204
  this.lastUpdate = update;
5204
5205
  this.hooks.onUpdate.call(update);
5205
5206
  }
@@ -5740,7 +5741,7 @@ var CommonExpressionsPlugin = function() {
5740
5741
  key: "applyParser",
5741
5742
  value: function applyParser(parser) {
5742
5743
  parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
5743
- if (childOptions && !hasTemplateKey(childOptions.key) && Array.isArray(obj)) {
5744
+ if ((childOptions === void 0 || !hasTemplateKey(childOptions.key)) && Array.isArray(obj)) {
5744
5745
  var values = obj.map(function(childVal) {
5745
5746
  return parser.parseObject(childVal, "value", options);
5746
5747
  }).filter(function(child) {
@@ -5751,7 +5752,7 @@ var CommonExpressionsPlugin = function() {
5751
5752
  }
5752
5753
  var multiNode = parser.createASTNode({
5753
5754
  type: "multi-node",
5754
- override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
5755
+ override: childOptions !== void 0 && !hasTemplateValues(childOptions.parentObj, childOptions.key),
5755
5756
  values: values
5756
5757
  }, obj);
5757
5758
  if (!multiNode) {
@@ -5762,7 +5763,7 @@ var CommonExpressionsPlugin = function() {
5762
5763
  v.parent = multiNode;
5763
5764
  });
5764
5765
  }
5765
- return [
5766
+ return childOptions === void 0 ? multiNode : [
5766
5767
  {
5767
5768
  path: _to_consumable_array(childOptions.path).concat([
5768
5769
  childOptions.key