mobx-state-tree 7.1.0 → 7.3.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.
@@ -1542,6 +1542,12 @@
1542
1542
  writable: true,
1543
1543
  value: false
1544
1544
  });
1545
+ Object.defineProperty(_this, "_endOfActionCallbacks", {
1546
+ enumerable: true,
1547
+ configurable: true,
1548
+ writable: true,
1549
+ value: void 0
1550
+ });
1545
1551
  Object.defineProperty(_this, "_observableInstanceState", {
1546
1552
  enumerable: true,
1547
1553
  configurable: true,
@@ -1612,8 +1618,8 @@
1612
1618
  id = childNode.value;
1613
1619
  }
1614
1620
  }
1615
- if (typeof id !== "string" && typeof id !== "number") {
1616
- throw new MstError("Instance identifier '".concat(_this.identifierAttribute, "' for type '").concat(_this.type.name, "' must be a string or a number"));
1621
+ if (typeof id !== "string" && typeof id !== "number" && typeof id !== "bigint") {
1622
+ throw new MstError("Instance identifier '".concat(_this.identifierAttribute, "' for type '").concat(_this.type.name, "' must be a string, a number or a bigint"));
1617
1623
  }
1618
1624
  // normalize internal identifier to string
1619
1625
  _this.identifier = normalizeIdentifier(id);
@@ -1751,6 +1757,33 @@
1751
1757
  enumerable: false,
1752
1758
  configurable: true
1753
1759
  });
1760
+ Object.defineProperty(ObjectNode.prototype, "enqueueEndOfAction", {
1761
+ enumerable: false,
1762
+ configurable: true,
1763
+ writable: true,
1764
+ value: function (callback) {
1765
+ var root = this.root;
1766
+ if (!root._endOfActionCallbacks) {
1767
+ root._endOfActionCallbacks = [];
1768
+ }
1769
+ root._endOfActionCallbacks.push(callback);
1770
+ }
1771
+ });
1772
+ Object.defineProperty(ObjectNode.prototype, "flushEndOfActionCallbacks", {
1773
+ enumerable: false,
1774
+ configurable: true,
1775
+ writable: true,
1776
+ value: function () {
1777
+ var root = this.root;
1778
+ while (root._endOfActionCallbacks && root._endOfActionCallbacks.length > 0) {
1779
+ var callbacks = root._endOfActionCallbacks;
1780
+ root._endOfActionCallbacks = undefined;
1781
+ callbacks.forEach(function (callback) {
1782
+ callback();
1783
+ });
1784
+ }
1785
+ }
1786
+ });
1754
1787
  Object.defineProperty(ObjectNode.prototype, "clearParent", {
1755
1788
  enumerable: false,
1756
1789
  configurable: true,
@@ -3232,9 +3265,10 @@
3232
3265
  var baseIsRunningAction = node._isRunningAction;
3233
3266
  node._isRunningAction = true;
3234
3267
  var previousContext = currentActionContext;
3268
+ var isRootActionContext = !previousContext;
3235
3269
  currentActionContext = context;
3236
3270
  try {
3237
- return runMiddleWares(node, context, fn);
3271
+ return runMiddleWares(node, context, fn, isRootActionContext);
3238
3272
  }
3239
3273
  finally {
3240
3274
  currentActionContext = previousContext;
@@ -3388,17 +3422,44 @@
3388
3422
  });
3389
3423
  return CollectedMiddlewares;
3390
3424
  }());
3391
- function runMiddleWares(node, baseCall, originalFn) {
3425
+ function runMiddleWares(node, baseCall, originalFn, isRootActionContext) {
3426
+ function runInActionScope(call, fn) {
3427
+ var execute = function () {
3428
+ var result;
3429
+ var error;
3430
+ try {
3431
+ result = fn.apply(null, call.args);
3432
+ }
3433
+ catch (e) {
3434
+ error = e;
3435
+ }
3436
+ if (isRootActionContext || !call.parentActionEvent) {
3437
+ try {
3438
+ node.root.flushEndOfActionCallbacks();
3439
+ }
3440
+ catch (flushError) {
3441
+ if (!error) {
3442
+ error = flushError;
3443
+ }
3444
+ }
3445
+ }
3446
+ if (error) {
3447
+ throw error;
3448
+ }
3449
+ return result;
3450
+ };
3451
+ return call.name ? mobx.action(call.name, execute)() : mobx.action(execute)();
3452
+ }
3392
3453
  var middlewares = new CollectedMiddlewares(node, originalFn);
3393
3454
  // Short circuit
3394
3455
  if (middlewares.isEmpty)
3395
- return mobx.action(originalFn).apply(null, baseCall.args);
3456
+ return runInActionScope(baseCall, originalFn);
3396
3457
  var result = null;
3397
3458
  function runNextMiddleware(call) {
3398
3459
  var middleware = middlewares.getNextMiddleware();
3399
3460
  var handler = middleware && middleware.handler;
3400
3461
  if (!handler) {
3401
- return mobx.action(originalFn).apply(null, call.args);
3462
+ return runInActionScope(call, originalFn);
3402
3463
  }
3403
3464
  // skip hooks if asked to
3404
3465
  if (!middleware.includeHooks && Hook[call.name]) {
@@ -3434,6 +3495,9 @@
3434
3495
  throw new MstError("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."));
3435
3496
  }
3436
3497
  }
3498
+ if (abortInvoked && (isRootActionContext || !call.parentActionEvent)) {
3499
+ return runInActionScope(call, function () { return result; });
3500
+ }
3437
3501
  return result;
3438
3502
  }
3439
3503
  return runNextMiddleware(baseCall);
@@ -3475,30 +3539,207 @@
3475
3539
  return _isActionContextThisOrChildOf(actionContext, parentOrThis, true);
3476
3540
  }
3477
3541
 
3478
- function safeStringify(value) {
3542
+ var defaultOptions = {
3543
+ enabled: false,
3544
+ indent: 2,
3545
+ maxStringLength: 100,
3546
+ maxArrayLength: 10,
3547
+ maxPropertyCount: 30,
3548
+ maxDepth: 5
3549
+ };
3550
+ var currentOptions = __assign({}, defaultOptions);
3551
+ /**
3552
+ * Configures how snapshots/values and type shapes are formatted inside
3553
+ * type-checking error messages. This is **opt-in**: by default MST keeps its
3554
+ * original single-line error formatting, so enabling this does not change
3555
+ * behavior for anyone who doesn't call it.
3556
+ *
3557
+ * The given options are merged over the current ones, so you can set only the
3558
+ * fields you care about.
3559
+ *
3560
+ * @example
3561
+ * // pretty-print large snapshots across multiple lines and truncate them
3562
+ * setErrorFormatting({ enabled: true })
3563
+ *
3564
+ * @example
3565
+ * // only bound the message size, without reflowing it onto multiple lines
3566
+ * setErrorFormatting({ enabled: true, indent: 0 })
3567
+ *
3568
+ * @example
3569
+ * // tweak the truncation limits
3570
+ * setErrorFormatting({ enabled: true, maxArrayLength: 3, maxStringLength: 40 })
3571
+ *
3572
+ * @param options A partial set of {@link ErrorFormattingOptions} to apply.
3573
+ */
3574
+ function setErrorFormatting(options) {
3575
+ currentOptions = __assign(__assign({}, currentOptions), options);
3576
+ }
3577
+ /**
3578
+ * Returns a copy of the current error formatting options (see
3579
+ * {@link setErrorFormatting}). Useful for temporarily overriding and then
3580
+ * restoring the configuration.
3581
+ *
3582
+ * @returns The current {@link ErrorFormattingOptions}.
3583
+ */
3584
+ function getErrorFormatting() {
3585
+ return __assign({}, currentOptions);
3586
+ }
3587
+
3588
+ function safeStringify(value, indent) {
3479
3589
  try {
3480
- return JSON.stringify(value);
3590
+ return JSON.stringify(value, null, indent);
3481
3591
  }
3482
3592
  catch (e) {
3483
3593
  // istanbul ignore next
3484
3594
  return "<Unserializable: ".concat(e, ">");
3485
3595
  }
3486
3596
  }
3597
+ function shortenPrintValue(valueInString) {
3598
+ return valueInString.length < 280
3599
+ ? valueInString
3600
+ : "".concat(valueInString.substring(0, 272), "......").concat(valueInString.substring(valueInString.length - 8));
3601
+ }
3602
+ /**
3603
+ * Returns a clone of `value` in which overly long strings are clipped and large
3604
+ * arrays/objects (or values nested too deeply) are summarized, so the result is
3605
+ * safe to print in an error message without flooding the screen.
3606
+ */
3607
+ function truncateForDisplay(value, depth, options) {
3608
+ if (typeof value === "string") {
3609
+ return value.length > options.maxStringLength
3610
+ ? "".concat(value.slice(0, options.maxStringLength), "\u2026 (").concat(value.length - options.maxStringLength, " more characters)")
3611
+ : value;
3612
+ }
3613
+ if (Array.isArray(value)) {
3614
+ if (depth >= options.maxDepth)
3615
+ return "[…]";
3616
+ var items = value
3617
+ .slice(0, options.maxArrayLength)
3618
+ .map(function (item) { return truncateForDisplay(item, depth + 1, options); });
3619
+ if (value.length > options.maxArrayLength) {
3620
+ items.push("\u2026 ".concat(value.length - options.maxArrayLength, " more items"));
3621
+ }
3622
+ return items;
3623
+ }
3624
+ if (isPlainObject(value)) {
3625
+ if (depth >= options.maxDepth)
3626
+ return "{…}";
3627
+ var result_1 = {};
3628
+ var keys = Object.keys(value);
3629
+ keys.slice(0, options.maxPropertyCount).forEach(function (key) {
3630
+ result_1[key] = truncateForDisplay(value[key], depth + 1, options);
3631
+ });
3632
+ if (keys.length > options.maxPropertyCount) {
3633
+ result_1["…"] = "".concat(keys.length - options.maxPropertyCount, " more keys");
3634
+ }
3635
+ return result_1;
3636
+ }
3637
+ return value;
3638
+ }
3487
3639
  /**
3488
3640
  * @internal
3489
3641
  * @hidden
3490
3642
  */
3491
3643
  function prettyPrintValue(value) {
3492
- return typeof value === "function"
3493
- ? "<function".concat(value.name ? " " + value.name : "", ">")
3494
- : isStateTreeNode(value)
3495
- ? "<".concat(value, ">")
3496
- : "`".concat(safeStringify(value), "`");
3644
+ if (typeof value === "function") {
3645
+ return "<function".concat(value.name ? " " + value.name : "", ">");
3646
+ }
3647
+ if (isStateTreeNode(value)) {
3648
+ return "<".concat(value, ">");
3649
+ }
3650
+ var options = getErrorFormatting();
3651
+ if (!options.enabled) {
3652
+ // Default behavior: serialize the value compactly on a single line.
3653
+ // JSON.stringify returns `undefined` for values like `undefined` itself,
3654
+ // which the template literal coerces back to a string.
3655
+ return "`".concat(safeStringify(value), "`");
3656
+ }
3657
+ // Opt-in behavior: clip long strings, big arrays/objects and deep nesting, and
3658
+ // (when indent > 0) pretty-print the result across multiple lines.
3659
+ var truncated = truncateForDisplay(value, 0, options);
3660
+ return "`".concat(safeStringify(truncated, options.indent || undefined), "`");
3497
3661
  }
3498
- function shortenPrintValue(valueInString) {
3499
- return valueInString.length < 280
3500
- ? valueInString
3501
- : "".concat(valueInString.substring(0, 272), "......").concat(valueInString.substring(valueInString.length - 8));
3662
+ /**
3663
+ * Re-indents a type description (as produced by `IType.describe()`) across
3664
+ * multiple lines, by breaking after the `{`, `}` and `;` separators used in
3665
+ * model shapes (while leaving union `|` and array `[]` parts inline).
3666
+ * Characters inside string literals (e.g. literal types like `"a;b"`) are left
3667
+ * untouched.
3668
+ *
3669
+ * `indentSize` is the number of spaces per nesting level; when it is `0` (or
3670
+ * negative) the description is returned unchanged on a single line. As this runs
3671
+ * while formatting an error that is already being thrown, it must never throw
3672
+ * itself: any unexpected input falls back to the original, unformatted
3673
+ * description.
3674
+ *
3675
+ * @internal
3676
+ * @hidden
3677
+ */
3678
+ function prettyPrintDescription(description, indentSize) {
3679
+ if (indentSize <= 0) {
3680
+ return description;
3681
+ }
3682
+ try {
3683
+ var step_1 = " ".repeat(indentSize);
3684
+ var result_2 = "";
3685
+ var depth_1 = 0;
3686
+ var stringDelimiter = null;
3687
+ var escaped = false;
3688
+ var newline = function () {
3689
+ // drop any trailing spaces (e.g. the "{ " / "; " separators) before breaking,
3690
+ // and never let a malformed (over-closed) shape produce a negative indent
3691
+ result_2 = result_2.replace(/[ \t]+$/, "");
3692
+ result_2 += "\n" + step_1.repeat(Math.max(0, depth_1));
3693
+ };
3694
+ for (var i = 0; i < description.length; i++) {
3695
+ var char = description[i];
3696
+ if (stringDelimiter) {
3697
+ result_2 += char;
3698
+ if (escaped) {
3699
+ escaped = false;
3700
+ }
3701
+ else if (char === "\\") {
3702
+ escaped = true;
3703
+ }
3704
+ else if (char === stringDelimiter) {
3705
+ stringDelimiter = null;
3706
+ }
3707
+ continue;
3708
+ }
3709
+ switch (char) {
3710
+ case '"':
3711
+ case "'":
3712
+ stringDelimiter = char;
3713
+ result_2 += char;
3714
+ break;
3715
+ case "{":
3716
+ depth_1++;
3717
+ result_2 += "{";
3718
+ newline();
3719
+ while (description[i + 1] === " ")
3720
+ i++;
3721
+ break;
3722
+ case "}":
3723
+ depth_1--;
3724
+ newline();
3725
+ result_2 += "}";
3726
+ break;
3727
+ case ";":
3728
+ result_2 += ";";
3729
+ newline();
3730
+ while (description[i + 1] === " ")
3731
+ i++;
3732
+ break;
3733
+ default:
3734
+ result_2 += char;
3735
+ }
3736
+ }
3737
+ return result_2;
3738
+ }
3739
+ catch (e) {
3740
+ // istanbul ignore next - defensive: never let formatting hide the real error
3741
+ return description;
3742
+ }
3502
3743
  }
3503
3744
  function toErrorString(error) {
3504
3745
  var value = error.value;
@@ -3517,12 +3758,18 @@
3517
3758
  ? "value"
3518
3759
  : "snapshot";
3519
3760
  var isSnapshotCompatible = type && isStateTreeNode(value) && type.is(getStateTreeNode(value).snapshot);
3761
+ // When error formatting is enabled, the type shape is re-indented using the
3762
+ // same indent setting as values; otherwise it's left on a single line.
3763
+ var formatting = getErrorFormatting();
3764
+ var describeType = function (t) {
3765
+ return formatting.enabled ? prettyPrintDescription(t.describe(), formatting.indent) : t.describe();
3766
+ };
3520
3767
  return ("".concat(pathPrefix).concat(currentTypename, " ").concat(prettyPrintValue(value), " is not assignable ").concat(type ? "to type: `".concat(type.name, "`") : "") +
3521
3768
  (error.message ? " (".concat(error.message, ")") : "") +
3522
3769
  (type
3523
3770
  ? isPrimitiveType(type) || isPrimitive(value)
3524
3771
  ? "."
3525
- : ", expected an instance of `".concat(type.name, "` or a snapshot like `").concat(type.describe(), "` instead.") +
3772
+ : ", expected an instance of `".concat(type.name, "` or a snapshot like `").concat(describeType(type), "` instead.") +
3526
3773
  (isSnapshotCompatible
3527
3774
  ? " (Note that a snapshot of the provided value is compatible with the targeted type)"
3528
3775
  : "")
@@ -3585,7 +3832,14 @@
3585
3832
  if (errors.length === 0) {
3586
3833
  return undefined;
3587
3834
  }
3588
- return ("Error while converting ".concat(shortenPrintValue(prettyPrintValue(value)), " to `").concat(type.name, "`:\n\n ") + errors.map(toErrorString).join("\n "));
3835
+ // When formatting is disabled, keep the original behavior of capping the
3836
+ // header value's length; when enabled, truncation already bounds its size.
3837
+ var printedValue = prettyPrintValue(value);
3838
+ var headerValue = getErrorFormatting().enabled
3839
+ ? printedValue
3840
+ : shortenPrintValue(printedValue);
3841
+ return ("Error while converting ".concat(headerValue, " to `").concat(type.name, "`:\n\n ") +
3842
+ errors.map(toErrorString).join("\n "));
3589
3843
  }
3590
3844
 
3591
3845
  var identifierCacheId = 0;
@@ -8111,7 +8365,7 @@
8111
8365
  value: function (value, context) {
8112
8366
  return isValidIdentifier(value)
8113
8367
  ? typeCheckSuccess()
8114
- : typeCheckFailure(context, value, "Value is not a valid identifier, which is a string or a number");
8368
+ : typeCheckFailure(context, value, "Value is not a valid identifier, which is a string, number or a bigint");
8115
8369
  }
8116
8370
  });
8117
8371
  Object.defineProperty(BaseReferenceType.prototype, "fireInvalidated", {
@@ -8200,6 +8454,23 @@
8200
8454
  onRefTargetDestroyedHookDisposer();
8201
8455
  }
8202
8456
  });
8457
+ var scheduleRetryAfterReconciliation = function () {
8458
+ var retry = function () {
8459
+ if (!storedRefNode.isAlive) {
8460
+ return;
8461
+ }
8462
+ if (_this.getSnapshot(storedRefNode) !== identifier) {
8463
+ return;
8464
+ }
8465
+ startWatching(false);
8466
+ };
8467
+ if (getCurrentActionContext()) {
8468
+ storedRefNode.root.enqueueEndOfAction(retry);
8469
+ }
8470
+ else {
8471
+ setImmediateWithFallback(retry);
8472
+ }
8473
+ };
8203
8474
  var startWatching = function (sync) {
8204
8475
  // re-create hook in case the stored ref gets reattached
8205
8476
  if (onRefTargetDestroyedHookDisposer) {
@@ -8217,12 +8488,13 @@
8217
8488
  refTargetNodeExists = storedRefNode.root.identifierCache.has(_this.targetType, normalizeIdentifier(identifier));
8218
8489
  }
8219
8490
  if (!refTargetNodeExists) {
8220
- // we cannot change the reference in sync mode
8221
- // since we are in the middle of a reconciliation/instantiation and the change would be overwritten
8222
- // for those cases just let the wrong reference be assigned and fail upon usage
8223
- // (like current references do)
8224
- // this means that effectively this code will only run when it is created from a snapshot
8225
- if (!sync) {
8491
+ // if the tree is already attached we may still be in the middle of a reconcile/applySnapshot,
8492
+ // so wait until the current MST action finishes before deciding whether to invalidate or
8493
+ // attach a watcher to a target that appeared later in the same action.
8494
+ if (sync) {
8495
+ scheduleRetryAfterReconciliation();
8496
+ }
8497
+ else {
8226
8498
  _this.fireInvalidated("invalidSnapshotReference", storedRefNode, identifier, null);
8227
8499
  }
8228
8500
  }
@@ -8572,7 +8844,7 @@
8572
8844
  * Inside a state tree, for each type can exist only one instance for each given identifier.
8573
8845
  * For example there couldn't be 2 instances of user with id 1. If you need more, consider using references.
8574
8846
  * Identifier can be used only as type property of a model.
8575
- * This type accepts as parameter the value type of the identifier field that can be either string or number.
8847
+ * This type accepts as parameter the value type of the identifier field that can be either string, number or bigint.
8576
8848
  *
8577
8849
  * Example:
8578
8850
  * ```ts
@@ -8599,6 +8871,110 @@
8599
8871
  * @returns
8600
8872
  */
8601
8873
  var identifierNumber = new IdentifierNumberType();
8874
+ /**
8875
+ * @internal
8876
+ * @hidden
8877
+ * IdentifierBigintType uses SimpleType<bigint | string | number, string, bigint> so snapshots serialize to string (JSON-safe).
8878
+ */
8879
+ var IdentifierBigintType = /** @class */ (function (_super) {
8880
+ __extends(IdentifierBigintType, _super);
8881
+ function IdentifierBigintType() {
8882
+ var _this = _super.call(this, "identifierBigint") || this;
8883
+ Object.defineProperty(_this, "flags", {
8884
+ enumerable: true,
8885
+ configurable: true,
8886
+ writable: true,
8887
+ value: TypeFlags.Identifier
8888
+ });
8889
+ return _this;
8890
+ }
8891
+ Object.defineProperty(IdentifierBigintType.prototype, "createNewInstance", {
8892
+ enumerable: false,
8893
+ configurable: true,
8894
+ writable: true,
8895
+ value: function (snapshot) {
8896
+ if (typeof snapshot === "bigint")
8897
+ return snapshot;
8898
+ return BigInt(snapshot);
8899
+ }
8900
+ });
8901
+ Object.defineProperty(IdentifierBigintType.prototype, "instantiate", {
8902
+ enumerable: false,
8903
+ configurable: true,
8904
+ writable: true,
8905
+ value: function (parent, subpath, environment, initialValue) {
8906
+ if (!parent || !(parent.type instanceof ModelType))
8907
+ throw new MstError("Identifier types can only be instantiated as direct child of a model type");
8908
+ return createScalarNode(this, parent, subpath, environment, initialValue);
8909
+ }
8910
+ });
8911
+ Object.defineProperty(IdentifierBigintType.prototype, "reconcile", {
8912
+ enumerable: false,
8913
+ configurable: true,
8914
+ writable: true,
8915
+ value: function (current, newValue, parent, subpath) {
8916
+ var currentVal = current.storedValue;
8917
+ var newVal = typeof newValue === "bigint" ? newValue : BigInt(newValue);
8918
+ if (currentVal !== newVal)
8919
+ throw new MstError("Tried to change identifier from '".concat(currentVal, "' to '").concat(newVal, "'. Changing identifiers is not allowed."));
8920
+ current.setParent(parent, subpath);
8921
+ return current;
8922
+ }
8923
+ });
8924
+ Object.defineProperty(IdentifierBigintType.prototype, "isValidSnapshot", {
8925
+ enumerable: false,
8926
+ configurable: true,
8927
+ writable: true,
8928
+ value: function (value, context) {
8929
+ if (typeof value === "bigint") {
8930
+ return typeCheckSuccess();
8931
+ }
8932
+ if (typeof value === "string" || typeof value === "number") {
8933
+ try {
8934
+ // BigInt primitive constructor verifies whether the value is a valid integer
8935
+ BigInt(value);
8936
+ return typeCheckSuccess();
8937
+ }
8938
+ catch (e) {
8939
+ var errorMessage = e instanceof Error ? e.message : String(e);
8940
+ return typeCheckFailure(context, value, "Value is not a valid ".concat(this.describe(), ": ").concat(errorMessage));
8941
+ }
8942
+ }
8943
+ return typeCheckFailure(context, value, "Value is not a valid ".concat(this.describe(), ", expected a bigint, a string or a number"));
8944
+ }
8945
+ });
8946
+ Object.defineProperty(IdentifierBigintType.prototype, "getSnapshot", {
8947
+ enumerable: false,
8948
+ configurable: true,
8949
+ writable: true,
8950
+ value: function (node) {
8951
+ return String(node.storedValue);
8952
+ }
8953
+ });
8954
+ Object.defineProperty(IdentifierBigintType.prototype, "describe", {
8955
+ enumerable: false,
8956
+ configurable: true,
8957
+ writable: true,
8958
+ value: function () {
8959
+ return "identifierBigint";
8960
+ }
8961
+ });
8962
+ return IdentifierBigintType;
8963
+ }(SimpleType));
8964
+ /**
8965
+ * `types.identifierBigint` - Similar to `types.identifier`. Snapshots serialize to string (JSON-safe) and deserialize from string, number or bigint.
8966
+ *
8967
+ * Example:
8968
+ * ```ts
8969
+ * const Todo = types.model("Todo", {
8970
+ * id: types.identifierBigint,
8971
+ * title: types.string
8972
+ * })
8973
+ * ```
8974
+ *
8975
+ * @returns
8976
+ */
8977
+ var identifierBigint = new IdentifierBigintType();
8602
8978
  /**
8603
8979
  * Returns if a given value represents an identifier type.
8604
8980
  *
@@ -8620,14 +8996,14 @@
8620
8996
  * @hidden
8621
8997
  */
8622
8998
  function isValidIdentifier(id) {
8623
- return typeof id === "string" || typeof id === "number";
8999
+ return typeof id === "string" || typeof id === "number" || typeof id === "bigint";
8624
9000
  }
8625
9001
  /**
8626
9002
  * @internal
8627
9003
  * @hidden
8628
9004
  */
8629
9005
  function assertIsValidIdentifier(id, argNumber) {
8630
- assertArg(id, isValidIdentifier, "string or number (identifier)", argNumber);
9006
+ assertArg(id, isValidIdentifier, "string, number or bigint (identifier)", argNumber);
8631
9007
  }
8632
9008
 
8633
9009
  /**
@@ -8795,6 +9171,7 @@
8795
9171
  frozen: frozen,
8796
9172
  identifier: identifier,
8797
9173
  identifierNumber: identifierNumber,
9174
+ identifierBigint: identifierBigint,
8798
9175
  late: late,
8799
9176
  lazy: lazy,
8800
9177
  undefined: undefinedType,
@@ -8821,6 +9198,7 @@
8821
9198
  exports.flow = flow;
8822
9199
  exports.getChildType = getChildType;
8823
9200
  exports.getEnv = getEnv;
9201
+ exports.getErrorFormatting = getErrorFormatting;
8824
9202
  exports.getIdentifier = getIdentifier;
8825
9203
  exports.getLivelinessChecking = getLivelinessChecking;
8826
9204
  exports.getMembers = getMembers;
@@ -8868,6 +9246,7 @@
8868
9246
  exports.recordPatches = recordPatches;
8869
9247
  exports.resolveIdentifier = resolveIdentifier;
8870
9248
  exports.resolvePath = resolvePath;
9249
+ exports.setErrorFormatting = setErrorFormatting;
8871
9250
  exports.setLivelinessChecking = setLivelinessChecking;
8872
9251
  exports.setLivelynessChecking = setLivelynessChecking;
8873
9252
  exports.splitJsonPath = splitJsonPath;