mobx-state-tree 5.4.1 → 5.4.2-pre.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.
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('mobx')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'mobx'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.mobxStateTree = {}, global.mobx));
5
- }(this, (function (exports, mobx) { 'use strict';
5
+ })(this, (function (exports, mobx) { 'use strict';
6
6
 
7
7
  var livelinessChecking = "warn";
8
8
  /**
@@ -49,7 +49,7 @@
49
49
  Hook["beforeDestroy"] = "beforeDestroy";
50
50
  })(Hook || (Hook = {}));
51
51
 
52
- /*! *****************************************************************************
52
+ /******************************************************************************
53
53
  Copyright (c) Microsoft Corporation.
54
54
 
55
55
  Permission to use, copy, modify, and/or distribute this software for any
@@ -63,7 +63,7 @@
63
63
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
64
64
  PERFORMANCE OF THIS SOFTWARE.
65
65
  ***************************************************************************** */
66
- /* global Reflect, Promise */
66
+ /* global Reflect, Promise, SuppressedError, Symbol */
67
67
 
68
68
  var extendStatics = function(d, b) {
69
69
  extendStatics = Object.setPrototypeOf ||
@@ -109,7 +109,7 @@
109
109
  function verb(n) { return function (v) { return step([n, v]); }; }
110
110
  function step(op) {
111
111
  if (f) throw new TypeError("Generator is already executing.");
112
- while (_) try {
112
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
113
113
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
114
114
  if (y = 0, t) op = [op[0] & 2, t.value];
115
115
  switch (op[0]) {
@@ -160,12 +160,20 @@
160
160
  return ar;
161
161
  }
162
162
 
163
- /** @deprecated */
164
- function __spread() {
165
- for (var ar = [], i = 0; i < arguments.length; i++)
166
- ar = ar.concat(__read(arguments[i]));
167
- return ar;
168
- }
163
+ function __spreadArray(to, from, pack) {
164
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
165
+ if (ar || !(i in from)) {
166
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
167
+ ar[i] = from[i];
168
+ }
169
+ }
170
+ return to.concat(ar || Array.prototype.slice.call(from));
171
+ }
172
+
173
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
174
+ var e = new Error(message);
175
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
176
+ };
169
177
 
170
178
  /**
171
179
  * Returns the _actual_ type of the given tree node. (Or throws)
@@ -463,7 +471,7 @@
463
471
  return parent.storedValue;
464
472
  parent = parent.parent;
465
473
  }
466
- throw fail("Failed to find the parent of " + getStateTreeNode(target) + " at depth " + depth);
474
+ throw fail("Failed to find the parent of ".concat(getStateTreeNode(target), " at depth ").concat(depth));
467
475
  }
468
476
  /**
469
477
  * Given a model instance, returns `true` if the object has a parent of given type, that is, is part of another object, map or array
@@ -501,7 +509,7 @@
501
509
  return parent.storedValue;
502
510
  parent = parent.parent;
503
511
  }
504
- throw fail("Failed to find the parent of " + getStateTreeNode(target) + " of a given type");
512
+ throw fail("Failed to find the parent of ".concat(getStateTreeNode(target), " of a given type"));
505
513
  }
506
514
  /**
507
515
  * Given an object in a model tree, returns the root object of that tree.
@@ -1356,7 +1364,7 @@
1356
1364
  writable: true,
1357
1365
  value: function () {
1358
1366
  var path = (this.isAlive ? this.path : this.pathUponDeath) || "<root>";
1359
- return this.type.name + "@" + path + (this.isAlive ? "" : " [dead]");
1367
+ return "".concat(this.type.name, "@").concat(path).concat(this.isAlive ? "" : " [dead]");
1360
1368
  }
1361
1369
  });
1362
1370
  Object.defineProperty(ScalarNode.prototype, "die", {
@@ -1502,7 +1510,7 @@
1502
1510
  enumerable: true,
1503
1511
  configurable: true,
1504
1512
  writable: true,
1505
- value: 0 /* UNINITIALIZED */
1513
+ value: 0 /* ObservableInstanceLifecycle.UNINITIALIZED */
1506
1514
  });
1507
1515
  Object.defineProperty(_this, "_childNodes", {
1508
1516
  enumerable: true,
@@ -1569,7 +1577,7 @@
1569
1577
  }
1570
1578
  }
1571
1579
  if (typeof id !== "string" && typeof id !== "number") {
1572
- throw fail("Instance identifier '" + _this.identifierAttribute + "' for type '" + _this.type.name + "' must be a string or a number");
1580
+ throw fail("Instance identifier '".concat(_this.identifierAttribute, "' for type '").concat(_this.type.name, "' must be a string or a number"));
1573
1581
  }
1574
1582
  // normalize internal identifier to string
1575
1583
  _this.identifier = normalizeIdentifier(id);
@@ -1607,7 +1615,7 @@
1607
1615
  writable: true,
1608
1616
  value: function (fireHooks) {
1609
1617
  if (fireHooks === void 0) { fireHooks = true; }
1610
- if (this._observableInstanceState === 0 /* UNINITIALIZED */) {
1618
+ if (this._observableInstanceState === 0 /* ObservableInstanceLifecycle.UNINITIALIZED */) {
1611
1619
  this.createObservableInstance(fireHooks);
1612
1620
  }
1613
1621
  }
@@ -1625,7 +1633,7 @@
1625
1633
  throw fail("assertion failed: the creation of the observable instance must be done on the initializing phase");
1626
1634
  }
1627
1635
  }
1628
- this._observableInstanceState = 1 /* CREATING */;
1636
+ this._observableInstanceState = 1 /* ObservableInstanceLifecycle.CREATING */;
1629
1637
  // make sure the parent chain is created as well
1630
1638
  // array with parent chain from parent to child
1631
1639
  var parentChain = [];
@@ -1635,7 +1643,7 @@
1635
1643
  // this is done to avoid traversing the whole tree to the root when using
1636
1644
  // the same reference again
1637
1645
  while (parent &&
1638
- parent._observableInstanceState === 0 /* UNINITIALIZED */) {
1646
+ parent._observableInstanceState === 0 /* ObservableInstanceLifecycle.UNINITIALIZED */) {
1639
1647
  parentChain.unshift(parent);
1640
1648
  parent = parent.parent;
1641
1649
  }
@@ -1669,7 +1677,7 @@
1669
1677
  finally {
1670
1678
  this._isRunningAction = false;
1671
1679
  }
1672
- this._observableInstanceState = 2 /* CREATED */;
1680
+ this._observableInstanceState = 2 /* ObservableInstanceLifecycle.CREATED */;
1673
1681
  this._snapshotComputed.trackAndCompute();
1674
1682
  if (this.isRoot)
1675
1683
  this._addSnapshotReaction();
@@ -1752,10 +1760,10 @@
1752
1760
  throw fail("assertion failed: new parent expected");
1753
1761
  }
1754
1762
  if (this.parent && parentChanged) {
1755
- throw fail("A node cannot exists twice in the state tree. Failed to add " + this + " to path '" + newParent.path + "/" + subpath + "'.");
1763
+ throw fail("A node cannot exists twice in the state tree. Failed to add ".concat(this, " to path '").concat(newParent.path, "/").concat(subpath, "'."));
1756
1764
  }
1757
1765
  if (!this.parent && newParent.root === this) {
1758
- throw fail("A state tree is not allowed to contain itself. Cannot assign " + this + " to path '" + newParent.path + "/" + subpath + "'");
1766
+ throw fail("A state tree is not allowed to contain itself. Cannot assign ".concat(this, " to path '").concat(newParent.path, "/").concat(subpath, "'"));
1759
1767
  }
1760
1768
  if (!this.parent && !!this.environment && this.environment !== newParent.root.environment) {
1761
1769
  throw fail("A state tree cannot be made part of another state tree as long as their environments are different.");
@@ -1814,7 +1822,7 @@
1814
1822
  value: function () {
1815
1823
  if (!this.isAlive)
1816
1824
  return this._snapshotUponDeath;
1817
- return this._observableInstanceState === 2 /* CREATED */
1825
+ return this._observableInstanceState === 2 /* ObservableInstanceLifecycle.CREATED */
1818
1826
  ? this._getActualSnapshot()
1819
1827
  : this._getCachedInitialSnapshot();
1820
1828
  }
@@ -1887,9 +1895,9 @@
1887
1895
  if (actionContext && actionContext.name != null) {
1888
1896
  // try to use the context, and if it not available use the node one
1889
1897
  var actionPath = (actionContext && actionContext.context && getPath(actionContext.context)) || escapedPath;
1890
- actionFullPath = actionPath + "." + actionContext.name + "()";
1898
+ actionFullPath = "".concat(actionPath, ".").concat(actionContext.name, "()");
1891
1899
  }
1892
- return "You are trying to read or write to an object that is no longer part of a state tree. (Object type: '" + this.type.name + "', Path upon death: '" + escapedPath + "', Subpath: '" + subpath + "', Action: '" + actionFullPath + "'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.";
1900
+ return "You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name, "', Path upon death: '").concat(escapedPath, "', Subpath: '").concat(subpath, "', Action: '").concat(actionFullPath, "'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.");
1893
1901
  }
1894
1902
  });
1895
1903
  Object.defineProperty(ObjectNode.prototype, "getChildNode", {
@@ -1902,7 +1910,7 @@
1902
1910
  });
1903
1911
  this._autoUnbox = false;
1904
1912
  try {
1905
- return this._observableInstanceState === 2 /* CREATED */
1913
+ return this._observableInstanceState === 2 /* ObservableInstanceLifecycle.CREATED */
1906
1914
  ? this.type.getChildNode(this, subpath)
1907
1915
  : this._childNodes[subpath];
1908
1916
  }
@@ -1919,7 +1927,7 @@
1919
1927
  this.assertAlive(EMPTY_OBJECT);
1920
1928
  this._autoUnbox = false;
1921
1929
  try {
1922
- return this._observableInstanceState === 2 /* CREATED */
1930
+ return this._observableInstanceState === 2 /* ObservableInstanceLifecycle.CREATED */
1923
1931
  ? this.type.getChildren(this)
1924
1932
  : convertChildNodesToArray(this._childNodes);
1925
1933
  }
@@ -1950,7 +1958,7 @@
1950
1958
  value: function (context) {
1951
1959
  this.assertAlive(context);
1952
1960
  if (!this.isRunningAction() && this.isProtected) {
1953
- throw fail("Cannot modify '" + this + "', the object is protected and can only be modified by using an action.");
1961
+ throw fail("Cannot modify '".concat(this, "', the object is protected and can only be modified by using an action."));
1954
1962
  }
1955
1963
  }
1956
1964
  });
@@ -1982,8 +1990,8 @@
1982
1990
  writable: true,
1983
1991
  value: function () {
1984
1992
  var path = (this.isAlive ? this.path : this.pathUponDeath) || "<root>";
1985
- var identifier = this.identifier ? "(id: " + this.identifier + ")" : "";
1986
- return this.type.name + "@" + path + identifier + (this.isAlive ? "" : " [dead]");
1993
+ var identifier = this.identifier ? "(id: ".concat(this.identifier, ")") : "";
1994
+ return "".concat(this.type.name, "@").concat(path).concat(identifier).concat(this.isAlive ? "" : " [dead]");
1987
1995
  }
1988
1996
  });
1989
1997
  Object.defineProperty(ObjectNode.prototype, "finalizeCreation", {
@@ -2065,7 +2073,7 @@
2065
2073
  configurable: true,
2066
2074
  writable: true,
2067
2075
  value: function () {
2068
- if (this._observableInstanceState === 0 /* UNINITIALIZED */) {
2076
+ if (this._observableInstanceState === 0 /* ObservableInstanceLifecycle.UNINITIALIZED */) {
2069
2077
  return;
2070
2078
  }
2071
2079
  this.getChildren().forEach(function (node) {
@@ -2074,8 +2082,8 @@
2074
2082
  // beforeDestroy should run before the disposers since else we could end up in a situation where
2075
2083
  // a disposer added with addDisposer at this stage (beforeDestroy) is actually never released
2076
2084
  this.baseAboutToDie();
2077
- this._internalEventsEmit("dispose" /* Dispose */);
2078
- this._internalEventsClear("dispose" /* Dispose */);
2085
+ this._internalEventsEmit("dispose" /* InternalEvents.Dispose */);
2086
+ this._internalEventsClear("dispose" /* InternalEvents.Dispose */);
2079
2087
  }
2080
2088
  });
2081
2089
  Object.defineProperty(ObjectNode.prototype, "finalizeDeath", {
@@ -2101,7 +2109,7 @@
2101
2109
  writable: true,
2102
2110
  value: function (onChange) {
2103
2111
  this._addSnapshotReaction();
2104
- return this._internalEventsRegister("snapshot" /* Snapshot */, onChange);
2112
+ return this._internalEventsRegister("snapshot" /* InternalEvents.Snapshot */, onChange);
2105
2113
  }
2106
2114
  });
2107
2115
  Object.defineProperty(ObjectNode.prototype, "emitSnapshot", {
@@ -2109,7 +2117,7 @@
2109
2117
  configurable: true,
2110
2118
  writable: true,
2111
2119
  value: function (snapshot) {
2112
- this._internalEventsEmit("snapshot" /* Snapshot */, snapshot);
2120
+ this._internalEventsEmit("snapshot" /* InternalEvents.Snapshot */, snapshot);
2113
2121
  }
2114
2122
  });
2115
2123
  Object.defineProperty(ObjectNode.prototype, "onPatch", {
@@ -2117,7 +2125,7 @@
2117
2125
  configurable: true,
2118
2126
  writable: true,
2119
2127
  value: function (handler) {
2120
- return this._internalEventsRegister("patch" /* Patch */, handler);
2128
+ return this._internalEventsRegister("patch" /* InternalEvents.Patch */, handler);
2121
2129
  }
2122
2130
  });
2123
2131
  Object.defineProperty(ObjectNode.prototype, "emitPatch", {
@@ -2125,12 +2133,12 @@
2125
2133
  configurable: true,
2126
2134
  writable: true,
2127
2135
  value: function (basePatch, source) {
2128
- if (this._internalEventsHasSubscribers("patch" /* Patch */)) {
2136
+ if (this._internalEventsHasSubscribers("patch" /* InternalEvents.Patch */)) {
2129
2137
  var localizedPatch = extend({}, basePatch, {
2130
2138
  path: source.path.substr(this.path.length) + "/" + basePatch.path // calculate the relative path of the patch
2131
2139
  });
2132
2140
  var _a = __read(splitPatch(localizedPatch), 2), patch = _a[0], reversePatch = _a[1];
2133
- this._internalEventsEmit("patch" /* Patch */, patch, reversePatch);
2141
+ this._internalEventsEmit("patch" /* InternalEvents.Patch */, patch, reversePatch);
2134
2142
  }
2135
2143
  if (this.parent)
2136
2144
  this.parent.emitPatch(basePatch, source);
@@ -2141,7 +2149,7 @@
2141
2149
  configurable: true,
2142
2150
  writable: true,
2143
2151
  value: function (disposer) {
2144
- return this._internalEventsHas("dispose" /* Dispose */, disposer);
2152
+ return this._internalEventsHas("dispose" /* InternalEvents.Dispose */, disposer);
2145
2153
  }
2146
2154
  });
2147
2155
  Object.defineProperty(ObjectNode.prototype, "addDisposer", {
@@ -2150,7 +2158,7 @@
2150
2158
  writable: true,
2151
2159
  value: function (disposer) {
2152
2160
  if (!this.hasDisposer(disposer)) {
2153
- this._internalEventsRegister("dispose" /* Dispose */, disposer, true);
2161
+ this._internalEventsRegister("dispose" /* InternalEvents.Dispose */, disposer, true);
2154
2162
  return;
2155
2163
  }
2156
2164
  throw fail("cannot add a disposer when it is already registered for execution");
@@ -2161,10 +2169,10 @@
2161
2169
  configurable: true,
2162
2170
  writable: true,
2163
2171
  value: function (disposer) {
2164
- if (!this._internalEventsHas("dispose" /* Dispose */, disposer)) {
2172
+ if (!this._internalEventsHas("dispose" /* InternalEvents.Dispose */, disposer)) {
2165
2173
  throw fail("cannot remove a disposer which was never registered for execution");
2166
2174
  }
2167
- this._internalEventsUnregister("dispose" /* Dispose */, disposer);
2175
+ this._internalEventsUnregister("dispose" /* InternalEvents.Dispose */, disposer);
2168
2176
  }
2169
2177
  });
2170
2178
  Object.defineProperty(ObjectNode.prototype, "removeMiddleware", {
@@ -2272,7 +2280,7 @@
2272
2280
  args[_i - 1] = arguments[_i];
2273
2281
  }
2274
2282
  if (this._internalEvents) {
2275
- (_a = this._internalEvents).emit.apply(_a, __spread([event], args));
2283
+ (_a = this._internalEvents).emit.apply(_a, __spreadArray([event], __read(args), false));
2276
2284
  }
2277
2285
  }
2278
2286
  });
@@ -2915,11 +2923,11 @@
2915
2923
  // We should not serialize MST nodes, even if we can, because we don't know if the receiving party can handle a raw snapshot instead of an
2916
2924
  // MST type instance. So if one wants to serialize a MST node that was pass in, either explitly pass: 1: an id, 2: a (relative) path, 3: a snapshot
2917
2925
  if (isStateTreeNode(arg))
2918
- return serializeTheUnserializable("[MSTNode: " + getType(arg).name + "]");
2926
+ return serializeTheUnserializable("[MSTNode: ".concat(getType(arg).name, "]"));
2919
2927
  if (typeof arg === "function")
2920
2928
  return serializeTheUnserializable("[function]");
2921
2929
  if (typeof arg === "object" && !isPlainObject(arg) && !isArray(arg))
2922
- return serializeTheUnserializable("[object " + ((arg && arg.constructor && arg.constructor.name) || "Complex Object") + "]");
2930
+ return serializeTheUnserializable("[object ".concat((arg && arg.constructor && arg.constructor.name) || "Complex Object", "]"));
2923
2931
  try {
2924
2932
  // Check if serializable, cycle free etc...
2925
2933
  // MWE: there must be a better way....
@@ -2960,7 +2968,7 @@
2960
2968
  function baseApplyAction(target, action) {
2961
2969
  var resolvedTarget = tryResolve(target, action.path || "");
2962
2970
  if (!resolvedTarget)
2963
- throw fail("Invalid action path: " + (action.path || ""));
2971
+ throw fail("Invalid action path: ".concat(action.path || ""));
2964
2972
  var node = getStateTreeNode(resolvedTarget);
2965
2973
  // Reserved functions
2966
2974
  if (action.name === "@APPLY_PATCHES") {
@@ -2970,7 +2978,7 @@
2970
2978
  return applySnapshot.call(null, resolvedTarget, action.args[0]);
2971
2979
  }
2972
2980
  if (!(typeof resolvedTarget[action.name] === "function"))
2973
- throw fail("Action '" + action.name + "' does not exist in '" + node.path + "'");
2981
+ throw fail("Action '".concat(action.name, "' does not exist in '").concat(node.path, "'"));
2974
2982
  return resolvedTarget[action.name].apply(resolvedTarget, action.args ? action.args.map(function (v) { return deserializeArgument(node, v); }) : []);
2975
2983
  }
2976
2984
  /**
@@ -3175,7 +3183,7 @@
3175
3183
  tree: getRoot(target),
3176
3184
  rootId: parentContext ? parentContext.rootId : id,
3177
3185
  parentId: parentContext ? parentContext.id : 0,
3178
- allParentIds: parentContext ? __spread(parentContext.allParentIds, [parentContext.id]) : [],
3186
+ allParentIds: parentContext ? __spreadArray(__spreadArray([], __read(parentContext.allParentIds), false), [parentContext.id], false) : [],
3179
3187
  parentEvent: parentContext,
3180
3188
  parentActionEvent: parentActionContext
3181
3189
  }, fn);
@@ -3331,11 +3339,11 @@
3331
3339
  {
3332
3340
  if (!nextInvoked && !abortInvoked) {
3333
3341
  var node2 = getStateTreeNode(call.tree);
3334
- throw fail("Neither the next() nor the abort() callback within the middleware " + handler.name + " for the action: \"" + call.name + "\" on the node: " + node2.type.name + " was invoked.");
3342
+ throw fail("Neither the next() nor the abort() callback within the middleware ".concat(handler.name, " for the action: \"").concat(call.name, "\" on the node: ").concat(node2.type.name, " was invoked."));
3335
3343
  }
3336
3344
  else if (nextInvoked && abortInvoked) {
3337
3345
  var node2 = getStateTreeNode(call.tree);
3338
- throw fail("The next() and abort() callback within the middleware " + handler.name + " for the action: \"" + call.name + "\" on the node: " + node2.type.name + " were invoked.");
3346
+ throw fail("The next() and abort() callback within the middleware ".concat(handler.name, " for the action: \"").concat(call.name, "\" on the node: ").concat(node2.type.name, " were invoked."));
3339
3347
  }
3340
3348
  }
3341
3349
  return result;
@@ -3385,7 +3393,7 @@
3385
3393
  }
3386
3394
  catch (e) {
3387
3395
  // istanbul ignore next
3388
- return "<Unserializable: " + e + ">";
3396
+ return "<Unserializable: ".concat(e, ">");
3389
3397
  }
3390
3398
  }
3391
3399
  /**
@@ -3394,15 +3402,15 @@
3394
3402
  */
3395
3403
  function prettyPrintValue(value) {
3396
3404
  return typeof value === "function"
3397
- ? "<function" + (value.name ? " " + value.name : "") + ">"
3405
+ ? "<function".concat(value.name ? " " + value.name : "", ">")
3398
3406
  : isStateTreeNode(value)
3399
- ? "<" + value + ">"
3400
- : "`" + safeStringify(value) + "`";
3407
+ ? "<".concat(value, ">")
3408
+ : "`".concat(safeStringify(value), "`");
3401
3409
  }
3402
3410
  function shortenPrintValue(valueInString) {
3403
3411
  return valueInString.length < 280
3404
3412
  ? valueInString
3405
- : valueInString.substring(0, 272) + "......" + valueInString.substring(valueInString.length - 8);
3413
+ : "".concat(valueInString.substring(0, 272), "......").concat(valueInString.substring(valueInString.length - 8));
3406
3414
  }
3407
3415
  function toErrorString(error) {
3408
3416
  var value = error.value;
@@ -3414,19 +3422,19 @@
3414
3422
  })
3415
3423
  .filter(function (path) { return path.length > 0; })
3416
3424
  .join("/");
3417
- var pathPrefix = fullPath.length > 0 ? "at path \"/" + fullPath + "\" " : "";
3425
+ var pathPrefix = fullPath.length > 0 ? "at path \"/".concat(fullPath, "\" ") : "";
3418
3426
  var currentTypename = isStateTreeNode(value)
3419
- ? "value of type " + getStateTreeNode(value).type.name + ":"
3427
+ ? "value of type ".concat(getStateTreeNode(value).type.name, ":")
3420
3428
  : isPrimitive(value)
3421
3429
  ? "value"
3422
3430
  : "snapshot";
3423
3431
  var isSnapshotCompatible = type && isStateTreeNode(value) && type.is(getStateTreeNode(value).snapshot);
3424
- return ("" + pathPrefix + currentTypename + " " + prettyPrintValue(value) + " is not assignable " + (type ? "to type: `" + type.name + "`" : "") +
3425
- (error.message ? " (" + error.message + ")" : "") +
3432
+ return ("".concat(pathPrefix).concat(currentTypename, " ").concat(prettyPrintValue(value), " is not assignable ").concat(type ? "to type: `".concat(type.name, "`") : "") +
3433
+ (error.message ? " (".concat(error.message, ")") : "") +
3426
3434
  (type
3427
3435
  ? isPrimitiveType(type) || isPrimitive(value)
3428
3436
  ? "."
3429
- : ", expected an instance of `" + type.name + "` or a snapshot like `" + type.describe() + "` instead." +
3437
+ : ", expected an instance of `".concat(type.name, "` or a snapshot like `").concat(type.describe(), "` instead.") +
3430
3438
  (isSnapshotCompatible
3431
3439
  ? " (Note that a snapshot of the provided value is compatible with the targeted type)"
3432
3440
  : "")
@@ -3489,7 +3497,7 @@
3489
3497
  if (errors.length === 0) {
3490
3498
  return undefined;
3491
3499
  }
3492
- return ("Error while converting " + shortenPrintValue(prettyPrintValue(value)) + " to `" + type.name + "`:\n\n " + errors.map(toErrorString).join("\n "));
3500
+ return ("Error while converting ".concat(shortenPrintValue(prettyPrintValue(value)), " to `").concat(type.name, "`:\n\n ") + errors.map(toErrorString).join("\n "));
3493
3501
  }
3494
3502
 
3495
3503
  var identifierCacheId = 0;
@@ -3537,7 +3545,7 @@
3537
3545
  writable: true,
3538
3546
  value: function (identifier) {
3539
3547
  var modificationId = this.lastCacheModificationPerId.get(identifier) || 0;
3540
- return this.cacheId + "-" + modificationId;
3548
+ return "".concat(this.cacheId, "-").concat(modificationId);
3541
3549
  }
3542
3550
  });
3543
3551
  Object.defineProperty(IdentifierCache.prototype, "addNodeToCache", {
@@ -3652,9 +3660,9 @@
3652
3660
  case 1:
3653
3661
  return matches[0];
3654
3662
  default:
3655
- throw fail("Cannot resolve a reference to type '" + type.name + "' with id: '" + identifier + "' unambigously, there are multiple candidates: " + matches
3663
+ throw fail("Cannot resolve a reference to type '".concat(type.name, "' with id: '").concat(identifier, "' unambigously, there are multiple candidates: ").concat(matches
3656
3664
  .map(function (n) { return n.path; })
3657
- .join(", "));
3665
+ .join(", ")));
3658
3666
  }
3659
3667
  }
3660
3668
  });
@@ -3670,7 +3678,7 @@
3670
3678
  if (existingNode) {
3671
3679
  if (existingNode.parent) {
3672
3680
  // istanbul ignore next
3673
- throw fail("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '" + (parent ? parent.path : "") + "/" + subpath + "', but it lives already at '" + existingNode.path + "'");
3681
+ throw fail("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(parent ? parent.path : "", "/").concat(subpath, "', but it lives already at '").concat(existingNode.path, "'"));
3674
3682
  }
3675
3683
  if (parent) {
3676
3684
  existingNode.setParent(parent, subpath);
@@ -3733,7 +3741,7 @@
3733
3741
  function getStateTreeNode(value) {
3734
3742
  if (!isStateTreeNode(value)) {
3735
3743
  // istanbul ignore next
3736
- throw fail("Value " + value + " is no MST Node");
3744
+ throw fail("Value ".concat(value, " is no MST Node"));
3737
3745
  }
3738
3746
  return value.$treenode;
3739
3747
  }
@@ -3759,7 +3767,7 @@
3759
3767
  function getRelativePathBetweenNodes(base, target) {
3760
3768
  // PRE condition target is (a child of) base!
3761
3769
  if (base.root !== target.root) {
3762
- throw fail("Cannot calculate relative path: objects '" + base + "' and '" + target + "' are not part of the same object tree");
3770
+ throw fail("Cannot calculate relative path: objects '".concat(base, "' and '").concat(target, "' are not part of the same object tree"));
3763
3771
  }
3764
3772
  var baseParts = splitJsonPath(base.path);
3765
3773
  var targetParts = splitJsonPath(target.path);
@@ -3816,7 +3824,7 @@
3816
3824
  }
3817
3825
  }
3818
3826
  }
3819
- throw fail("Could not resolve '" + part + "' in path '" + (joinJsonPath(pathParts.slice(0, i)) || "/") + "' while resolving '" + joinJsonPath(pathParts) + "'");
3827
+ throw fail("Could not resolve '".concat(part, "' in path '").concat(joinJsonPath(pathParts.slice(0, i)) || "/", "' while resolving '").concat(joinJsonPath(pathParts), "'"));
3820
3828
  }
3821
3829
  }
3822
3830
  catch (e) {
@@ -4132,7 +4140,7 @@
4132
4140
  }
4133
4141
  // make a copy just in case it changes
4134
4142
  var handlers = this.handlers.slice();
4135
- handlers.forEach(function (f) { return f.apply(void 0, __spread(args)); });
4143
+ handlers.forEach(function (f) { return f.apply(void 0, __spreadArray([], __read(args), false)); });
4136
4144
  }
4137
4145
  });
4138
4146
  return EventHandler;
@@ -4225,7 +4233,7 @@
4225
4233
  }
4226
4234
  var handler = this.eventHandlers && this.eventHandlers[event];
4227
4235
  if (handler) {
4228
- (_a = handler).emit.apply(_a, __spread(args));
4236
+ (_a = handler).emit.apply(_a, __spreadArray([], __read(args), false));
4229
4237
  }
4230
4238
  }
4231
4239
  });
@@ -4267,7 +4275,7 @@
4267
4275
  * @hidden
4268
4276
  */
4269
4277
  function warnError(msg) {
4270
- console.warn(new Error("[mobx-state-tree] " + msg));
4278
+ console.warn(new Error("[mobx-state-tree] ".concat(msg)));
4271
4279
  }
4272
4280
  /**
4273
4281
  * @internal
@@ -4277,7 +4285,7 @@
4277
4285
  {
4278
4286
  if (!fn(value)) {
4279
4287
  // istanbul ignore next
4280
- throw fail("expected " + typeName + " as argument " + asArray(argNumber).join(" or ") + ", got " + value + " instead");
4288
+ throw fail("expected ".concat(typeName, " as argument ").concat(asArray(argNumber).join(" or "), ", got ").concat(value, " instead"));
4281
4289
  }
4282
4290
  }
4283
4291
  }
@@ -4295,10 +4303,10 @@
4295
4303
  function assertIsNumber(value, argNumber, min, max) {
4296
4304
  assertArg(value, function (n) { return typeof n === "number"; }, "number", argNumber);
4297
4305
  if (min !== undefined) {
4298
- assertArg(value, function (n) { return n >= min; }, "number greater than " + min, argNumber);
4306
+ assertArg(value, function (n) { return n >= min; }, "number greater than ".concat(min), argNumber);
4299
4307
  }
4300
4308
  if (max !== undefined) {
4301
- assertArg(value, function (n) { return n <= max; }, "number lesser than " + max, argNumber);
4309
+ assertArg(value, function (n) { return n <= max; }, "number lesser than ".concat(max), argNumber);
4302
4310
  }
4303
4311
  }
4304
4312
  /**
@@ -4377,7 +4385,7 @@
4377
4385
  }
4378
4386
  return __generator(this, function (_a) {
4379
4387
  switch (_a.label) {
4380
- case 0: return [4 /*yield*/, p.apply(void 0, __spread(args))];
4388
+ case 0: return [4 /*yield*/, p.apply(void 0, __spreadArray([], __read(args), false))];
4381
4389
  case 1: return [2 /*return*/, (_a.sent())];
4382
4390
  }
4383
4391
  });
@@ -4434,7 +4442,7 @@
4434
4442
  tree: parentContext.tree,
4435
4443
  context: parentContext.context,
4436
4444
  parentId: parentContext.id,
4437
- allParentIds: __spread(parentContext.allParentIds, [parentContext.id]),
4445
+ allParentIds: __spreadArray(__spreadArray([], __read(parentContext.allParentIds), false), [parentContext.id], false),
4438
4446
  rootId: parentContext.rootId,
4439
4447
  parentEvent: parentContext,
4440
4448
  parentActionEvent: parentActionContext
@@ -4614,7 +4622,7 @@
4614
4622
  stringStartsWith(path, "./") ||
4615
4623
  stringStartsWith(path, "../");
4616
4624
  if (!valid) {
4617
- throw fail("a json path must be either rooted, empty or relative, but got '" + path + "'");
4625
+ throw fail("a json path must be either rooted, empty or relative, but got '".concat(path, "'"));
4618
4626
  }
4619
4627
  // '/a/b/c' -> ["a", "b", "c"]
4620
4628
  // '../../b/c' -> ["..", "..", "b", "c"]
@@ -4660,7 +4668,7 @@
4660
4668
  configurable: true,
4661
4669
  writable: true,
4662
4670
  value: function () {
4663
- return "snapshotProcessor(" + this._subtype.describe() + ")";
4671
+ return "snapshotProcessor(".concat(this._subtype.describe(), ")");
4664
4672
  }
4665
4673
  });
4666
4674
  Object.defineProperty(SnapshotProcessor.prototype, "preProcessSnapshot", {
@@ -5076,7 +5084,7 @@
5076
5084
  if (!type.identifierAttribute)
5077
5085
  return current;
5078
5086
  if (current && current !== type.identifierAttribute) {
5079
- throw fail("The objects in a map should all have the same identifier attribute, expected '" + current + "', but child of type '" + type.name + "' declared attribute '" + type.identifierAttribute + "' as identifier");
5087
+ throw fail("The objects in a map should all have the same identifier attribute, expected '".concat(current, "', but child of type '").concat(type.name, "' declared attribute '").concat(type.identifierAttribute, "' as identifier"));
5080
5088
  }
5081
5089
  return type.identifierAttribute;
5082
5090
  }, undefined);
@@ -5200,7 +5208,7 @@
5200
5208
  if (this.identifierMode === MapIdentifierMode.YES && node instanceof ObjectNode) {
5201
5209
  var identifier = node.identifier;
5202
5210
  if (identifier !== expected)
5203
- throw fail("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '" + identifier + "', but expected: '" + expected + "'");
5211
+ throw fail("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(identifier, "', but expected: '").concat(expected, "'"));
5204
5212
  }
5205
5213
  }
5206
5214
  });
@@ -5372,7 +5380,7 @@
5372
5380
  * @returns
5373
5381
  */
5374
5382
  function map(subtype) {
5375
- return new MapType("Map<string, " + subtype.name + ">", subtype);
5383
+ return new MapType("Map<string, ".concat(subtype.name, ">"), subtype);
5376
5384
  }
5377
5385
  /**
5378
5386
  * Returns if a given value represents a map type.
@@ -5689,7 +5697,7 @@
5689
5697
  */
5690
5698
  function array(subtype) {
5691
5699
  assertIsType(subtype, 1);
5692
- return new ArrayType(subtype.name + "[]", subtype);
5700
+ return new ArrayType("".concat(subtype.name, "[]"), subtype);
5693
5701
  }
5694
5702
  function reconcileArrayChildren(parent, childType, oldNodes, newValues, newPaths) {
5695
5703
  var nothingChanged = true;
@@ -5723,7 +5731,7 @@
5723
5731
  // check if already belongs to the same parent. if so, avoid pushing item in. only swapping can occur.
5724
5732
  if (isStateTreeNode(newValue) && getStateTreeNode(newValue).parent === parent) {
5725
5733
  // this node is owned by this parent, but not in the reconcilable set, so it must be double
5726
- throw fail("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '" + parent.path + "/" + newPath + "', but it lives already at '" + getStateTreeNode(newValue).path + "'");
5734
+ throw fail("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(parent.path, "/").concat(newPath, "', but it lives already at '").concat(getStateTreeNode(newValue).path, "'"));
5727
5735
  }
5728
5736
  nothingChanged = false;
5729
5737
  var newNode = valueAsNode(childType, parent, newPath, newValue);
@@ -5839,7 +5847,7 @@
5839
5847
  var alreadySeenKeys = new Set();
5840
5848
  keysList.forEach(function (key) {
5841
5849
  if (alreadySeenKeys.has(key)) {
5842
- throw fail(key + " is declared twice in the model. Model should not contain the same keys");
5850
+ throw fail("".concat(key, " is declared twice in the model. Model should not contain the same keys"));
5843
5851
  }
5844
5852
  alreadySeenKeys.add(key);
5845
5853
  });
@@ -5847,7 +5855,7 @@
5847
5855
  return keysList.reduce(function (props, key) {
5848
5856
  // warn if user intended a HOOK
5849
5857
  if (key in Hook) {
5850
- throw fail("Hook '" + key + "' was defined as property. Hooks should be defined as part of the actions");
5858
+ throw fail("Hook '".concat(key, "' was defined as property. Hooks should be defined as part of the actions"));
5851
5859
  }
5852
5860
  // the user intended to use a view
5853
5861
  var descriptor = Object.getOwnPropertyDescriptor(declaredProps, key);
@@ -5874,14 +5882,14 @@
5874
5882
  else if (isType(value)) ;
5875
5883
  // its a function, maybe the user wanted a view?
5876
5884
  else if (typeof value === "function") {
5877
- throw fail("Invalid type definition for property '" + key + "', it looks like you passed a function. Did you forget to invoke it, or did you intend to declare a view / action?");
5885
+ throw fail("Invalid type definition for property '".concat(key, "', it looks like you passed a function. Did you forget to invoke it, or did you intend to declare a view / action?"));
5878
5886
  }
5879
5887
  // no other complex values
5880
5888
  else if (typeof value === "object") {
5881
- throw fail("Invalid type definition for property '" + key + "', it looks like you passed an object. Try passing another model type or a types.frozen.");
5889
+ throw fail("Invalid type definition for property '".concat(key, "', it looks like you passed an object. Try passing another model type or a types.frozen."));
5882
5890
  }
5883
5891
  else {
5884
- throw fail("Invalid type definition for property '" + key + "', cannot infer a type from a value like '" + value + "' (" + typeof value + ")");
5892
+ throw fail("Invalid type definition for property '".concat(key, "', cannot infer a type from a value like '").concat(value, "' (").concat(typeof value, ")"));
5885
5893
  }
5886
5894
  return props;
5887
5895
  }, declaredProps);
@@ -5994,7 +6002,7 @@
5994
6002
  this.forAllProps(function (propName, propType) {
5995
6003
  if (propType.flags & TypeFlags.Identifier) {
5996
6004
  if (identifierAttribute)
5997
- throw fail("Cannot define property '" + propName + "' as object identifier, property '" + identifierAttribute + "' is already defined as identifier property");
6005
+ throw fail("Cannot define property '".concat(propName, "' as object identifier, property '").concat(identifierAttribute, "' is already defined as identifier property"));
5998
6006
  identifierAttribute = propName;
5999
6007
  }
6000
6008
  });
@@ -6040,10 +6048,10 @@
6040
6048
  Object.keys(actions).forEach(function (name) {
6041
6049
  // warn if preprocessor was given
6042
6050
  if (name === PRE_PROCESS_SNAPSHOT)
6043
- throw fail("Cannot define action '" + PRE_PROCESS_SNAPSHOT + "', it should be defined using 'type.preProcessSnapshot(fn)' instead");
6051
+ throw fail("Cannot define action '".concat(PRE_PROCESS_SNAPSHOT, "', it should be defined using 'type.preProcessSnapshot(fn)' instead"));
6044
6052
  // warn if postprocessor was given
6045
6053
  if (name === POST_PROCESS_SNAPSHOT)
6046
- throw fail("Cannot define action '" + POST_PROCESS_SNAPSHOT + "', it should be defined using 'type.postProcessSnapshot(fn)' instead");
6054
+ throw fail("Cannot define action '".concat(POST_PROCESS_SNAPSHOT, "', it should be defined using 'type.postProcessSnapshot(fn)' instead"));
6047
6055
  var action2 = actions[name];
6048
6056
  // apply hook composition
6049
6057
  var baseAction = self[name];
@@ -6073,7 +6081,7 @@
6073
6081
  value: function (fn) {
6074
6082
  var _this = this;
6075
6083
  if (typeof fn !== "function") {
6076
- throw fail("You passed an " + typeof fn + " to volatile state as an argument, when function is expected");
6084
+ throw fail("You passed an ".concat(typeof fn, " to volatile state as an argument, when function is expected"));
6077
6085
  }
6078
6086
  var stateInitializer = function (self) {
6079
6087
  _this.instantiateVolatileState(self, fn(self));
@@ -6102,7 +6110,7 @@
6102
6110
  var initializer = function (self) {
6103
6111
  var _a = fn(self), actions = _a.actions, views = _a.views, state = _a.state, rest = __rest(_a, ["actions", "views", "state"]);
6104
6112
  for (var key in rest)
6105
- throw fail("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '" + key + "'");
6113
+ throw fail("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(key, "'"));
6106
6114
  if (state)
6107
6115
  _this.instantiateVolatileState(self, state);
6108
6116
  if (views)
@@ -6286,7 +6294,7 @@
6286
6294
  atom.reportObserved();
6287
6295
  }
6288
6296
  catch (e) {
6289
- throw fail(name + " property is declared twice");
6297
+ throw fail("".concat(name, " property is declared twice"));
6290
6298
  }
6291
6299
  res[name] = _this.getChildNode(node, name).snapshot;
6292
6300
  });
@@ -6314,7 +6322,7 @@
6314
6322
  writable: true,
6315
6323
  value: function (node, subpath, patch) {
6316
6324
  if (!(patch.op === "replace" || patch.op === "add")) {
6317
- throw fail("object does not support operation " + patch.op);
6325
+ throw fail("object does not support operation ".concat(patch.op));
6318
6326
  }
6319
6327
  node.storedValue[subpath] = patch.value;
6320
6328
  }
@@ -6546,7 +6554,7 @@
6546
6554
  return typeCheckSuccess();
6547
6555
  }
6548
6556
  var typeName = this.name === "Date" ? "Date or a unix milliseconds timestamp" : this.name;
6549
- return typeCheckFailure(context, value, "Value is not a " + typeName);
6557
+ return typeCheckFailure(context, value, "Value is not a ".concat(typeName));
6550
6558
  }
6551
6559
  });
6552
6560
  return CoreType;
@@ -6739,7 +6747,7 @@
6739
6747
  if (isPrimitive(value) && value === this.value) {
6740
6748
  return typeCheckSuccess();
6741
6749
  }
6742
- return typeCheckFailure(context, value, "Value is not a literal " + JSON.stringify(this.value));
6750
+ return typeCheckFailure(context, value, "Value is not a literal ".concat(JSON.stringify(this.value)));
6743
6751
  }
6744
6752
  });
6745
6753
  return Literal;
@@ -6921,7 +6929,7 @@
6921
6929
  assertIsString(option, i + 1);
6922
6930
  });
6923
6931
  }
6924
- var type = union.apply(void 0, __spread(realOptions.map(function (option) { return literal("" + option); })));
6932
+ var type = union.apply(void 0, __spreadArray([], __read(realOptions.map(function (option) { return literal("" + option); })), false));
6925
6933
  if (typeof name === "string")
6926
6934
  type.name = name;
6927
6935
  return type;
@@ -7017,7 +7025,7 @@
7017
7025
  if (this._dispatcher) {
7018
7026
  return this._dispatcher(value);
7019
7027
  }
7020
- // find the most accomodating type
7028
+ // find the most accommodating type
7021
7029
  // if we are using reconciliation try the current node type first (fix for #1045)
7022
7030
  if (reconcileCurrentType) {
7023
7031
  if (reconcileCurrentType.is(value)) {
@@ -7081,7 +7089,7 @@
7081
7089
  otherTypes[_i - 1] = arguments[_i];
7082
7090
  }
7083
7091
  var options = isType(optionsOrType) ? undefined : optionsOrType;
7084
- var types = isType(optionsOrType) ? __spread([optionsOrType], otherTypes) : otherTypes;
7092
+ var types = isType(optionsOrType) ? __spreadArray([optionsOrType], __read(otherTypes), false) : otherTypes;
7085
7093
  var name = "(" + types.map(function (type) { return type.name; }).join(" | ") + ")";
7086
7094
  // check all options
7087
7095
  {
@@ -7443,7 +7451,7 @@
7443
7451
  * @returns
7444
7452
  */
7445
7453
  function late(nameOrType, maybeType) {
7446
- var name = typeof nameOrType === "string" ? nameOrType : "late(" + nameOrType.toString() + ")";
7454
+ var name = typeof nameOrType === "string" ? nameOrType : "late(".concat(nameOrType.toString(), ")");
7447
7455
  var type = typeof nameOrType === "string" ? maybeType : nameOrType;
7448
7456
  // checks that the type is actually a late type
7449
7457
  {
@@ -7515,7 +7523,7 @@
7515
7523
  node.parent.applyPatches([
7516
7524
  {
7517
7525
  op: "replace",
7518
- path: "/" + node.subpath,
7526
+ path: "/".concat(node.subpath),
7519
7527
  value: node.snapshot
7520
7528
  }
7521
7529
  ]);
@@ -7529,7 +7537,7 @@
7529
7537
  configurable: true,
7530
7538
  writable: true,
7531
7539
  value: function () {
7532
- return "<lazy " + this.name + ">";
7540
+ return "<lazy ".concat(this.name, ">");
7533
7541
  }
7534
7542
  });
7535
7543
  Object.defineProperty(Lazy.prototype, "instantiate", {
@@ -7583,7 +7591,7 @@
7583
7591
  var Frozen = /** @class */ (function (_super) {
7584
7592
  __extends(Frozen, _super);
7585
7593
  function Frozen(subType) {
7586
- var _this = _super.call(this, subType ? "frozen(" + subType.name + ")" : "frozen") || this;
7594
+ var _this = _super.call(this, subType ? "frozen(".concat(subType.name, ")") : "frozen") || this;
7587
7595
  Object.defineProperty(_this, "subType", {
7588
7596
  enumerable: true,
7589
7597
  configurable: true,
@@ -7739,7 +7747,7 @@
7739
7747
  this.identifier = id;
7740
7748
  }
7741
7749
  else {
7742
- throw fail("Can only store references to tree nodes or identifiers, got: '" + value + "'");
7750
+ throw fail("Can only store references to tree nodes or identifiers, got: '".concat(value, "'"));
7743
7751
  }
7744
7752
  }
7745
7753
  Object.defineProperty(StoredReference.prototype, "updateResolvedReference", {
@@ -7756,7 +7764,7 @@
7756
7764
  // reference was initialized with the identifier of the target
7757
7765
  var target = root.identifierCache.resolve(targetType, normalizedId);
7758
7766
  if (!target) {
7759
- throw new InvalidReferenceError("[mobx-state-tree] Failed to resolve reference '" + this.identifier + "' to type '" + this.targetType.name + "' (from node: " + node.path + ")");
7767
+ throw new InvalidReferenceError("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier, "' to type '").concat(this.targetType.name, "' (from node: ").concat(node.path, ")"));
7760
7768
  }
7761
7769
  this.resolvedReference = {
7762
7770
  node: target,
@@ -7795,7 +7803,7 @@
7795
7803
  var BaseReferenceType = /** @class */ (function (_super) {
7796
7804
  __extends(BaseReferenceType, _super);
7797
7805
  function BaseReferenceType(targetType, onInvalidated) {
7798
- var _this = _super.call(this, "reference(" + targetType.name + ")") || this;
7806
+ var _this = _super.call(this, "reference(".concat(targetType.name, ")")) || this;
7799
7807
  Object.defineProperty(_this, "targetType", {
7800
7808
  enumerable: true,
7801
7809
  configurable: true,
@@ -8220,7 +8228,7 @@
8220
8228
  value: function (current, newValue, parent, subpath) {
8221
8229
  // we don't consider detaching here since identifier are scalar nodes, and scalar nodes cannot be detached
8222
8230
  if (current.storedValue !== newValue)
8223
- throw fail("Tried to change identifier from '" + current.storedValue + "' to '" + newValue + "'. Changing identifiers is not allowed.");
8231
+ throw fail("Tried to change identifier from '".concat(current.storedValue, "' to '").concat(newValue, "'. Changing identifiers is not allowed."));
8224
8232
  current.setParent(parent, subpath);
8225
8233
  return current;
8226
8234
  }
@@ -8231,7 +8239,7 @@
8231
8239
  writable: true,
8232
8240
  value: function (value, context) {
8233
8241
  if (typeof value !== this.validType) {
8234
- return typeCheckFailure(context, value, "Value is not a valid " + this.describe() + ", expected a " + this.validType);
8242
+ return typeCheckFailure(context, value, "Value is not a valid ".concat(this.describe(), ", expected a ").concat(this.validType));
8235
8243
  }
8236
8244
  return typeCheckSuccess();
8237
8245
  }
@@ -8442,7 +8450,7 @@
8442
8450
  return typeCheckSuccess();
8443
8451
  var typeError = this.options.getValidationMessage(value);
8444
8452
  if (typeError) {
8445
- return typeCheckFailure(context, value, "Invalid value for type '" + this.name + "': " + typeError);
8453
+ return typeCheckFailure(context, value, "Invalid value for type '".concat(this.name, "': ").concat(typeError));
8446
8454
  }
8447
8455
  return typeCheckSuccess();
8448
8456
  }
@@ -8606,4 +8614,4 @@
8606
8614
 
8607
8615
  Object.defineProperty(exports, '__esModule', { value: true });
8608
8616
 
8609
- })));
8617
+ }));