@player-ui/metrics-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.
@@ -1454,22 +1454,6 @@ var MetricsPlugin = function() {
1454
1454
  }
1455
1455
  });
1456
1456
  };
1457
- var unpackNode = function unpackNode(item) {
1458
- var _item_children_, _item_children, _item_children_1, _item_children1;
1459
- var unpacked = [];
1460
- 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) {
1461
- var _item_children__value_children_, _item_children__value_children, _item_children_2, _item_children2;
1462
- 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") {
1463
- var _item_children__value_children_1, _item_children__value_children1, _item_children_3, _item_children3;
1464
- ((_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) {
1465
- unpacked.push(value);
1466
- });
1467
- }
1468
- } else {
1469
- unpacked.push(item);
1470
- }
1471
- return unpacked;
1472
- };
1473
1457
  var hasSomethingToResolve = function hasSomethingToResolve(str) {
1474
1458
  return bindingResolveLookup(str) || expressionResolveLookup(str);
1475
1459
  };
@@ -2825,6 +2809,7 @@ var MetricsPlugin = function() {
2825
2809
  }
2826
2810
  };
2827
2811
  var identifier = function() {
2812
+ var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
2828
2813
  if (!isIdentifierChar(ch)) {
2829
2814
  return;
2830
2815
  }
@@ -2835,6 +2820,14 @@ var MetricsPlugin = function() {
2835
2820
  }
2836
2821
  value += ch;
2837
2822
  }
2823
+ if (allowBoolValue) {
2824
+ if (value === "true") {
2825
+ return toValue(true);
2826
+ }
2827
+ if (value === "false") {
2828
+ return toValue(false);
2829
+ }
2830
+ }
2838
2831
  if (value) {
2839
2832
  var maybeNumber = Number(value);
2840
2833
  value = isNaN(maybeNumber) ? value : maybeNumber;
@@ -2883,8 +2876,9 @@ var MetricsPlugin = function() {
2883
2876
  }
2884
2877
  };
2885
2878
  var simpleSegment = function() {
2879
+ var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
2886
2880
  var _nestedPath, _ref;
2887
- return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier();
2881
+ return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
2888
2882
  };
2889
2883
  var segment = function() {
2890
2884
  var segments = [];
@@ -2899,6 +2893,7 @@ var MetricsPlugin = function() {
2899
2893
  return toConcatenatedNode(segments);
2900
2894
  };
2901
2895
  var optionallyQuotedSegment = function() {
2896
+ var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
2902
2897
  whitespace();
2903
2898
  if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
2904
2899
  var singleQuote = ch === SINGLE_QUOTE;
@@ -2907,7 +2902,7 @@ var MetricsPlugin = function() {
2907
2902
  next(singleQuote ? SINGLE_QUOTE : DOUBLE_QUOTE);
2908
2903
  return id;
2909
2904
  }
2910
- return simpleSegment();
2905
+ return simpleSegment(allowBoolValue);
2911
2906
  };
2912
2907
  var equals = function() {
2913
2908
  if (ch !== EQUALS) {
@@ -2927,7 +2922,7 @@ var MetricsPlugin = function() {
2927
2922
  whitespace();
2928
2923
  if (equals()) {
2929
2924
  whitespace();
2930
- var second = optionallyQuotedSegment();
2925
+ var second = optionallyQuotedSegment(true);
2931
2926
  value = toQuery(value, second);
2932
2927
  whitespace();
2933
2928
  }
@@ -3115,7 +3110,7 @@ var MetricsPlugin = function() {
3115
3110
  appendPathSegments(getValueForNode(resolvedNode));
3116
3111
  break;
3117
3112
  case "Value":
3118
- appendPathSegments(resolvedNode.value);
3113
+ appendPathSegments(typeof resolvedNode.value === "boolean" ? String(resolvedNode.value) : resolvedNode.value);
3119
3114
  break;
3120
3115
  case "Query":
3121
3116
  {
@@ -4682,23 +4677,8 @@ var MetricsPlugin = function() {
4682
4677
  function Parser() {
4683
4678
  _class_call_check(this, Parser);
4684
4679
  this.hooks = {
4685
- /**
4686
- * A hook to interact with an object _before_ parsing it into an AST
4687
- *
4688
- * @param value - The object we're are about to parse
4689
- * @returns - A new value to parse.
4690
- * If undefined, the original value is used.
4691
- * If null, we stop parsing this node.
4692
- */ onParseObject: new SyncWaterfallHook(),
4693
- /**
4694
- * A callback to interact with an AST _after_ we parse it into the AST
4695
- *
4696
- * @param value - The object we parsed
4697
- * @param node - The AST node we generated
4698
- * @returns - A new AST node to use
4699
- * If undefined, the original value is used.
4700
- * If null, we ignore this node all together
4701
- */ onCreateASTNode: new SyncWaterfallHook(),
4680
+ onParseObject: new SyncWaterfallHook(),
4681
+ onCreateASTNode: new SyncWaterfallHook(),
4702
4682
  parseNode: new SyncBailHook()
4703
4683
  };
4704
4684
  }
@@ -4840,20 +4820,14 @@ var MetricsPlugin = function() {
4840
4820
  function Resolver(root, options) {
4841
4821
  _class_call_check(this, Resolver);
4842
4822
  this.hooks = {
4843
- /** A hook to allow skipping of the resolution tree for a specific node */ skipResolve: new SyncWaterfallHook(),
4844
- /** An event emitted before calculating the next update */ beforeUpdate: new SyncHook(),
4845
- /** An event emitted after calculating the next update */ afterUpdate: new SyncHook(),
4846
- /** The options passed to a node to resolve it to an object */ resolveOptions: new SyncWaterfallHook(),
4847
- /** A hook to transform the AST node into a new AST node before resolving it */ beforeResolve: new SyncWaterfallHook(),
4848
- /**
4849
- * A hook to transform an AST node into it's resolved value.
4850
- * This runs _before_ any children are resolved
4851
- */ resolve: new SyncWaterfallHook(),
4852
- /**
4853
- * A hook to transform the resolved value of an AST node.
4854
- * This runs _after_ all children nodes are resolved
4855
- */ afterResolve: new SyncWaterfallHook(),
4856
- /** Called at the very end of a node's tree being updated */ afterNodeUpdate: new SyncHook()
4823
+ skipResolve: new SyncWaterfallHook(),
4824
+ beforeUpdate: new SyncHook(),
4825
+ afterUpdate: new SyncHook(),
4826
+ resolveOptions: new SyncWaterfallHook(),
4827
+ beforeResolve: new SyncWaterfallHook(),
4828
+ resolve: new SyncWaterfallHook(),
4829
+ afterResolve: new SyncWaterfallHook(),
4830
+ afterNodeUpdate: new SyncHook()
4857
4831
  };
4858
4832
  this.root = root;
4859
4833
  this.options = options;
@@ -4861,6 +4835,7 @@ var MetricsPlugin = function() {
4861
4835
  this.ASTMap = /* @__PURE__ */ new Map();
4862
4836
  this.logger = options.logger;
4863
4837
  this.idCache = /* @__PURE__ */ new Set();
4838
+ this.AsyncIdMap = /* @__PURE__ */ new Map();
4864
4839
  }
4865
4840
  _create_class(Resolver, [
4866
4841
  {
@@ -4871,13 +4846,27 @@ var MetricsPlugin = function() {
4871
4846
  },
4872
4847
  {
4873
4848
  key: "update",
4874
- value: function update(changes) {
4849
+ value: function update(changes, asyncChanges) {
4850
+ var _this = this;
4875
4851
  this.hooks.beforeUpdate.call(changes);
4876
4852
  var resolveCache = /* @__PURE__ */ new Map();
4877
4853
  this.idCache.clear();
4878
4854
  var prevASTMap = new Map(this.ASTMap);
4879
4855
  this.ASTMap.clear();
4880
- var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap);
4856
+ var prevAsyncIdMap = new Map(this.AsyncIdMap);
4857
+ var nextAsyncIdMap = /* @__PURE__ */ new Map();
4858
+ asyncChanges === null || asyncChanges === void 0 ? void 0 : asyncChanges.forEach(function(id) {
4859
+ var current = prevAsyncIdMap.get(id);
4860
+ while(current && prevASTMap.has(current)){
4861
+ var next = prevASTMap.get(current);
4862
+ if (next && _this.resolveCache.has(next)) {
4863
+ _this.resolveCache.delete(next);
4864
+ }
4865
+ current = current.parent;
4866
+ }
4867
+ });
4868
+ var updated = this.computeTree(this.root, void 0, changes, resolveCache, toNodeResolveOptions(this.options), void 0, prevASTMap, nextAsyncIdMap);
4869
+ this.AsyncIdMap = nextAsyncIdMap;
4881
4870
  this.resolveCache = resolveCache;
4882
4871
  this.hooks.afterUpdate.call(updated.value);
4883
4872
  return updated.value;
@@ -4931,9 +4920,8 @@ var MetricsPlugin = function() {
4931
4920
  },
4932
4921
  {
4933
4922
  key: "computeTree",
4934
- value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap) {
4923
+ value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nextAsyncIdMap) {
4935
4924
  var _this = this;
4936
- var _partiallyResolvedParent_parent_parent, _partiallyResolvedParent_parent, _resolvedAST_parent, _partiallyResolvedParent_parent1;
4937
4925
  var dependencyModel = new DependencyModel(options.data.model);
4938
4926
  dependencyModel.trackSubset("core");
4939
4927
  var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
@@ -4952,15 +4940,6 @@ var MetricsPlugin = function() {
4952
4940
  var previousDeps = previousResult === null || previousResult === void 0 ? void 0 : previousResult.dependencies;
4953
4941
  var dataChanged = caresAboutDataChanges(dataChanges, previousDeps);
4954
4942
  var shouldUseLastValue = this.hooks.skipResolve.call(!dataChanged, node, resolveOptions);
4955
- var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
4956
- parent: partiallyResolvedParent
4957
- });
4958
- var _this_hooks_beforeResolve_call;
4959
- var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
4960
- type: "empty"
4961
- };
4962
- 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");
4963
- 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";
4964
4943
  if (previousResult && shouldUseLastValue) {
4965
4944
  var update2 = _object_spread_props(_object_spread({}, previousResult), {
4966
4945
  updated: false
@@ -4972,6 +4951,30 @@ var MetricsPlugin = function() {
4972
4951
  updated: false
4973
4952
  });
4974
4953
  cacheUpdate.set(AST, resolvedUpdate);
4954
+ if (resolvedUpdate.node.type === "async") {
4955
+ nextAsyncIdMap.set(resolvedUpdate.node.id, resolvedUpdate.node);
4956
+ }
4957
+ var _resolvedUpdate_node_asyncNodesResolved;
4958
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
4959
+ try {
4960
+ 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){
4961
+ var key = _step.value;
4962
+ nextAsyncIdMap.set(key, resolvedUpdate.node);
4963
+ }
4964
+ } catch (err) {
4965
+ _didIteratorError = true;
4966
+ _iteratorError = err;
4967
+ } finally{
4968
+ try {
4969
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
4970
+ _iterator.return();
4971
+ }
4972
+ } finally{
4973
+ if (_didIteratorError) {
4974
+ throw _iteratorError;
4975
+ }
4976
+ }
4977
+ }
4975
4978
  var handleChildNode = function(childNode) {
4976
4979
  var _prevASTMap_get;
4977
4980
  var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
@@ -4994,10 +4997,37 @@ var MetricsPlugin = function() {
4994
4997
  repopulateASTMapFromCache(previousResult, node, rawParent);
4995
4998
  return update2;
4996
4999
  }
4997
- if (isNestedMultiNodeWithAsync) {
4998
- resolvedAST.parent = partiallyResolvedParent.parent;
4999
- } else {
5000
- resolvedAST.parent = partiallyResolvedParent;
5000
+ var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
5001
+ parent: partiallyResolvedParent
5002
+ });
5003
+ var _this_hooks_beforeResolve_call;
5004
+ var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
5005
+ type: "empty"
5006
+ };
5007
+ resolvedAST.parent = partiallyResolvedParent;
5008
+ if (resolvedAST.type === "async") {
5009
+ nextAsyncIdMap.set(resolvedAST.id, resolvedAST);
5010
+ }
5011
+ var _resolvedAST_asyncNodesResolved;
5012
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
5013
+ try {
5014
+ for(var _iterator = ((_resolvedAST_asyncNodesResolved = resolvedAST.asyncNodesResolved) !== null && _resolvedAST_asyncNodesResolved !== void 0 ? _resolvedAST_asyncNodesResolved : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5015
+ var id = _step.value;
5016
+ nextAsyncIdMap.set(id, resolvedAST);
5017
+ }
5018
+ } catch (err) {
5019
+ _didIteratorError = true;
5020
+ _iteratorError = err;
5021
+ } finally{
5022
+ try {
5023
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
5024
+ _iterator.return();
5025
+ }
5026
+ } finally{
5027
+ if (_didIteratorError) {
5028
+ throw _iteratorError;
5029
+ }
5030
+ }
5001
5031
  }
5002
5032
  resolveOptions.node = resolvedAST;
5003
5033
  this.ASTMap.set(resolvedAST, node);
@@ -5011,7 +5041,7 @@ var MetricsPlugin = function() {
5011
5041
  if ("children" in resolvedAST) {
5012
5042
  var _resolvedAST_children;
5013
5043
  var newChildren = (_resolvedAST_children = resolvedAST.children) === null || _resolvedAST_children === void 0 ? void 0 : _resolvedAST_children.map(function(child) {
5014
- var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
5044
+ var computedChildTree = _this.computeTree(child.value, node, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
5015
5045
  var childTreeDeps = computedChildTree.dependencies, childNode = computedChildTree.node, childUpdated = computedChildTree.updated, childValue = computedChildTree.value;
5016
5046
  childTreeDeps.forEach(function(binding) {
5017
5047
  return childDependencies.add(binding);
@@ -5032,40 +5062,18 @@ var MetricsPlugin = function() {
5032
5062
  resolvedAST.children = newChildren;
5033
5063
  } else if (resolvedAST.type === "multi-node") {
5034
5064
  var childValue = [];
5035
- var rawParentToPassIn = isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : node;
5036
- var hasAsync = resolvedAST.values.map(function(value, index) {
5037
- return value.type === "async" ? index : -1;
5038
- }).filter(function(index) {
5039
- return index !== -1;
5040
- });
5041
- var newValues = resolvedAST.values.map(function(mValue) {
5042
- var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap);
5065
+ var rawParentToPassIn = node;
5066
+ resolvedAST.values = resolvedAST.values.map(function(mValue) {
5067
+ var mTree = _this.computeTree(mValue, rawParentToPassIn, dataChanges, cacheUpdate, resolveOptions, resolvedAST, prevASTMap, nextAsyncIdMap);
5043
5068
  if (mTree.value !== void 0 && mTree.value !== null) {
5044
- if (mValue.type === "async" && mValue.flatten && mTree.value.asset && Array.isArray(mTree.value.asset.values)) {
5045
- unpackAndPush(mTree.value, childValue);
5046
- } else {
5047
- childValue.push(mTree.value);
5048
- }
5069
+ mTree.dependencies.forEach(function(bindingDep) {
5070
+ return childDependencies.add(bindingDep);
5071
+ });
5072
+ updated = updated || mTree.updated;
5073
+ childValue.push(mTree.value);
5049
5074
  }
5050
- mTree.dependencies.forEach(function(bindingDep) {
5051
- return childDependencies.add(bindingDep);
5052
- });
5053
- updated = updated || mTree.updated;
5054
5075
  return mTree.node;
5055
5076
  });
5056
- if (hasAsync.length > 0) {
5057
- var copy = newValues;
5058
- hasAsync.forEach(function(index) {
5059
- var _copy;
5060
- if (copy[index]) (_copy = copy).splice.apply(_copy, [
5061
- index,
5062
- 1
5063
- ].concat(_to_consumable_array(unpackNode(copy[index]))));
5064
- });
5065
- resolvedAST.values = copy;
5066
- } else {
5067
- resolvedAST.values = newValues;
5068
- }
5069
5077
  resolved = childValue;
5070
5078
  }
5071
5079
  childDependencies.forEach(function(bindingDep) {
@@ -5086,7 +5094,7 @@ var MetricsPlugin = function() {
5086
5094
  value: resolved,
5087
5095
  dependencies: /* @__PURE__ */ new Set(_to_consumable_array(dependencyModel.getDependencies()).concat(_to_consumable_array(childDependencies)))
5088
5096
  };
5089
- this.hooks.afterNodeUpdate.call(node, isNestedMultiNode ? partiallyResolvedParent === null || partiallyResolvedParent === void 0 ? void 0 : partiallyResolvedParent.parent : rawParent, update);
5097
+ this.hooks.afterNodeUpdate.call(node, rawParent, update);
5090
5098
  cacheUpdate.set(node, update);
5091
5099
  return update;
5092
5100
  }
@@ -5094,15 +5102,6 @@ var MetricsPlugin = function() {
5094
5102
  ]);
5095
5103
  return Resolver;
5096
5104
  }();
5097
- function unpackAndPush(item, initial) {
5098
- if (item.asset.values && Array.isArray(item.asset.values)) {
5099
- item.asset.values.forEach(function(i) {
5100
- unpackAndPush(i, initial);
5101
- });
5102
- } else {
5103
- initial.push(item);
5104
- }
5105
- }
5106
5105
  var CrossfieldProvider = /*#__PURE__*/ function() {
5107
5106
  function CrossfieldProvider(initialView, parser, logger) {
5108
5107
  _class_call_check(this, CrossfieldProvider);
@@ -5170,9 +5169,11 @@ var MetricsPlugin = function() {
5170
5169
  _create_class(ViewInstance, [
5171
5170
  {
5172
5171
  key: "updateAsync",
5173
- value: function updateAsync() {
5172
+ value: function updateAsync(asyncNode) {
5174
5173
  var _this_resolver;
5175
- var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update();
5174
+ var update = (_this_resolver = this.resolver) === null || _this_resolver === void 0 ? void 0 : _this_resolver.update(/* @__PURE__ */ new Set(), /* @__PURE__ */ new Set([
5175
+ asyncNode
5176
+ ]));
5176
5177
  this.lastUpdate = update;
5177
5178
  this.hooks.onUpdate.call(update);
5178
5179
  }
@@ -5713,7 +5714,7 @@ var MetricsPlugin = function() {
5713
5714
  key: "applyParser",
5714
5715
  value: function applyParser(parser) {
5715
5716
  parser.hooks.parseNode.tap("multi-node", function(obj, nodeType, options, childOptions) {
5716
- if (childOptions && !hasTemplateKey(childOptions.key) && Array.isArray(obj)) {
5717
+ if ((childOptions === void 0 || !hasTemplateKey(childOptions.key)) && Array.isArray(obj)) {
5717
5718
  var values = obj.map(function(childVal) {
5718
5719
  return parser.parseObject(childVal, "value", options);
5719
5720
  }).filter(function(child) {
@@ -5724,7 +5725,7 @@ var MetricsPlugin = function() {
5724
5725
  }
5725
5726
  var multiNode = parser.createASTNode({
5726
5727
  type: "multi-node",
5727
- override: !hasTemplateValues(childOptions.parentObj, childOptions.key),
5728
+ override: childOptions !== void 0 && !hasTemplateValues(childOptions.parentObj, childOptions.key),
5728
5729
  values: values
5729
5730
  }, obj);
5730
5731
  if (!multiNode) {
@@ -5735,7 +5736,7 @@ var MetricsPlugin = function() {
5735
5736
  v.parent = multiNode;
5736
5737
  });
5737
5738
  }
5738
- return [
5739
+ return childOptions === void 0 ? multiNode : [
5739
5740
  {
5740
5741
  path: _to_consumable_array(childOptions.path).concat([
5741
5742
  childOptions.key