aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-06 07:21:49 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-06 07:21:49 -0700
commit1c1346dfa9eca7309be0d0ea681386f5d7f55164 (patch)
tree8b460f0fd2574a1e166c5df5bb5fe73d5fe2c1ea
parent58af6db3a7db259f0f07114307d97655ec02f5b4 (diff)
downloadbun-1c1346dfa9eca7309be0d0ea681386f5d7f55164.tar.gz
bun-1c1346dfa9eca7309be0d0ea681386f5d7f55164.tar.zst
bun-1c1346dfa9eca7309be0d0ea681386f5d7f55164.zip
Add `node:assert` to list of hardcoded modules to fix ESM compat issue
Diffstat (limited to '')
-rw-r--r--src/bun.js/assert.exports.js3202
-rw-r--r--src/bun.js/javascript.zig52
2 files changed, 3241 insertions, 13 deletions
diff --git a/src/bun.js/assert.exports.js b/src/bun.js/assert.exports.js
new file mode 100644
index 000000000..1b41c2cb7
--- /dev/null
+++ b/src/bun.js/assert.exports.js
@@ -0,0 +1,3202 @@
+var __create = Object.create;
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __getProtoOf = Object.getPrototypeOf,
+ __hasOwnProp = Object.prototype.hasOwnProperty;
+var __markAsModule = (target) => __defProp(target, "__esModule", { value: !0 });
+var __commonJS = (cb, mod) =>
+ function () {
+ return (
+ mod || (0, cb[Object.keys(cb)[0]])((mod = { exports: {} }).exports, mod),
+ mod.exports
+ );
+ };
+var __reExport = (target, module2, desc) => {
+ if ((module2 && typeof module2 == "object") || typeof module2 == "function")
+ for (let key of __getOwnPropNames(module2))
+ !__hasOwnProp.call(target, key) &&
+ key !== "default" &&
+ __defProp(target, key, {
+ get: () => module2[key],
+ enumerable:
+ !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable,
+ });
+ return target;
+ },
+ __toModule = (module2) =>
+ __reExport(
+ __markAsModule(
+ __defProp(
+ module2 != null ? __create(__getProtoOf(module2)) : {},
+ "default",
+ module2 && module2.__esModule && "default" in module2
+ ? { get: () => module2.default, enumerable: !0 }
+ : { value: module2, enumerable: !0 }
+ )
+ ),
+ module2
+ );
+
+var require = (path) => import.meta.require(path);
+
+// assert/build/internal/errors.js
+var require_errors = __commonJS({
+ "assert/build/internal/errors.js"(exports, module2) {
+ "use strict";
+ function _typeof(obj) {
+ return (
+ typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
+ ? (_typeof = function (obj2) {
+ return typeof obj2;
+ })
+ : (_typeof = function (obj2) {
+ return obj2 &&
+ typeof Symbol == "function" &&
+ obj2.constructor === Symbol &&
+ obj2 !== Symbol.prototype
+ ? "symbol"
+ : typeof obj2;
+ }),
+ _typeof(obj)
+ );
+ }
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor))
+ throw new TypeError("Cannot call a class as a function");
+ }
+ function _possibleConstructorReturn(self, call) {
+ return call && (_typeof(call) === "object" || typeof call == "function")
+ ? call
+ : _assertThisInitialized(self);
+ }
+ function _assertThisInitialized(self) {
+ if (self === void 0)
+ throw new ReferenceError(
+ "this hasn't been initialised - super() hasn't been called"
+ );
+ return self;
+ }
+ function _getPrototypeOf(o) {
+ return (
+ (_getPrototypeOf = Object.setPrototypeOf
+ ? Object.getPrototypeOf
+ : function (o2) {
+ return o2.__proto__ || Object.getPrototypeOf(o2);
+ }),
+ _getPrototypeOf(o)
+ );
+ }
+ function _inherits(subClass, superClass) {
+ if (typeof superClass != "function" && superClass !== null)
+ throw new TypeError(
+ "Super expression must either be null or a function"
+ );
+ (subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: { value: subClass, writable: !0, configurable: !0 },
+ })),
+ superClass && _setPrototypeOf(subClass, superClass);
+ }
+ function _setPrototypeOf(o, p) {
+ return (
+ (_setPrototypeOf =
+ Object.setPrototypeOf ||
+ function (o2, p2) {
+ return (o2.__proto__ = p2), o2;
+ }),
+ _setPrototypeOf(o, p)
+ );
+ }
+ var codes = {},
+ assert,
+ util;
+ function createErrorType(code, message, Base) {
+ Base || (Base = Error);
+ function getMessage(arg1, arg2, arg3) {
+ return typeof message == "string" ? message : message(arg1, arg2, arg3);
+ }
+ var NodeError = /* @__PURE__ */ (function (_Base) {
+ _inherits(NodeError2, _Base);
+ function NodeError2(arg1, arg2, arg3) {
+ var _this;
+ return (
+ _classCallCheck(this, NodeError2),
+ (_this = _possibleConstructorReturn(
+ this,
+ _getPrototypeOf(NodeError2).call(
+ this,
+ getMessage(arg1, arg2, arg3)
+ )
+ )),
+ (_this.code = code),
+ _this
+ );
+ }
+ return NodeError2;
+ })(Base);
+ codes[code] = NodeError;
+ }
+ function oneOf(expected, thing) {
+ if (Array.isArray(expected)) {
+ var len = expected.length;
+ return (
+ (expected = expected.map(function (i) {
+ return String(i);
+ })),
+ len > 2
+ ? "one of "
+ .concat(thing, " ")
+ .concat(expected.slice(0, len - 1).join(", "), ", or ") +
+ expected[len - 1]
+ : len === 2
+ ? "one of "
+ .concat(thing, " ")
+ .concat(expected[0], " or ")
+ .concat(expected[1])
+ : "of ".concat(thing, " ").concat(expected[0])
+ );
+ } else return "of ".concat(thing, " ").concat(String(expected));
+ }
+ function startsWith(str, search, pos) {
+ return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
+ }
+ function endsWith(str, search, this_len) {
+ return (
+ (this_len === void 0 || this_len > str.length) &&
+ (this_len = str.length),
+ str.substring(this_len - search.length, this_len) === search
+ );
+ }
+ function includes(str, search, start) {
+ return (
+ typeof start != "number" && (start = 0),
+ start + search.length > str.length
+ ? !1
+ : str.indexOf(search, start) !== -1
+ );
+ }
+ createErrorType(
+ "ERR_AMBIGUOUS_ARGUMENT",
+ 'The "%s" argument is ambiguous. %s',
+ TypeError
+ );
+ createErrorType(
+ "ERR_INVALID_ARG_TYPE",
+ function (name, expected, actual) {
+ assert === void 0 && (assert = require_assert()),
+ assert(typeof name == "string", "'name' must be a string");
+ var determiner;
+ typeof expected == "string" && startsWith(expected, "not ")
+ ? ((determiner = "must not be"),
+ (expected = expected.replace(/^not /, "")))
+ : (determiner = "must be");
+ var msg;
+ if (endsWith(name, " argument"))
+ msg = "The "
+ .concat(name, " ")
+ .concat(determiner, " ")
+ .concat(oneOf(expected, "type"));
+ else {
+ var type = includes(name, ".") ? "property" : "argument";
+ msg = 'The "'
+ .concat(name, '" ')
+ .concat(type, " ")
+ .concat(determiner, " ")
+ .concat(oneOf(expected, "type"));
+ }
+ return (msg += ". Received type ".concat(_typeof(actual))), msg;
+ },
+ TypeError
+ );
+ createErrorType(
+ "ERR_INVALID_ARG_VALUE",
+ function (name, value) {
+ var reason =
+ arguments.length > 2 && arguments[2] !== void 0
+ ? arguments[2]
+ : "is invalid";
+ util === void 0 && (util = require("util"));
+ var inspected = util.inspect(value);
+ return (
+ inspected.length > 128 &&
+ (inspected = "".concat(inspected.slice(0, 128), "...")),
+ "The argument '"
+ .concat(name, "' ")
+ .concat(reason, ". Received ")
+ .concat(inspected)
+ );
+ },
+ TypeError,
+ RangeError
+ );
+ createErrorType(
+ "ERR_INVALID_RETURN_VALUE",
+ function (input, name, value) {
+ var type;
+ return (
+ value && value.constructor && value.constructor.name
+ ? (type = "instance of ".concat(value.constructor.name))
+ : (type = "type ".concat(_typeof(value))),
+ "Expected "
+ .concat(input, ' to be returned from the "')
+ .concat(name, '"') + " function but got ".concat(type, ".")
+ );
+ },
+ TypeError
+ );
+ createErrorType(
+ "ERR_MISSING_ARGS",
+ function () {
+ for (
+ var _len = arguments.length, args = new Array(_len), _key = 0;
+ _key < _len;
+ _key++
+ )
+ args[_key] = arguments[_key];
+ assert === void 0 && (assert = require_assert()),
+ assert(args.length > 0, "At least one arg needs to be specified");
+ var msg = "The ",
+ len = args.length;
+ switch (
+ ((args = args.map(function (a) {
+ return '"'.concat(a, '"');
+ })),
+ len)
+ ) {
+ case 1:
+ msg += "".concat(args[0], " argument");
+ break;
+ case 2:
+ msg += "".concat(args[0], " and ").concat(args[1], " arguments");
+ break;
+ default:
+ (msg += args.slice(0, len - 1).join(", ")),
+ (msg += ", and ".concat(args[len - 1], " arguments"));
+ break;
+ }
+ return "".concat(msg, " must be specified");
+ },
+ TypeError
+ );
+ module2.exports.codes = codes;
+ },
+});
+
+// assert/build/internal/assert/assertion_error.js
+var require_assertion_error = __commonJS({
+ "assert/build/internal/assert/assertion_error.js"(exports, module2) {
+ "use strict";
+ function _objectSpread(target) {
+ for (var i = 1; i < arguments.length; i++) {
+ var source = arguments[i] != null ? arguments[i] : {},
+ ownKeys = Object.keys(source);
+ typeof Object.getOwnPropertySymbols == "function" &&
+ (ownKeys = ownKeys.concat(
+ Object.getOwnPropertySymbols(source).filter(function (sym) {
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
+ })
+ )),
+ ownKeys.forEach(function (key) {
+ _defineProperty(target, key, source[key]);
+ });
+ }
+ return target;
+ }
+ function _defineProperty(obj, key, value) {
+ return (
+ key in obj
+ ? Object.defineProperty(obj, key, {
+ value,
+ enumerable: !0,
+ configurable: !0,
+ writable: !0,
+ })
+ : (obj[key] = value),
+ obj
+ );
+ }
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor))
+ throw new TypeError("Cannot call a class as a function");
+ }
+ function _defineProperties(target, props) {
+ for (var i = 0; i < props.length; i++) {
+ var descriptor = props[i];
+ (descriptor.enumerable = descriptor.enumerable || !1),
+ (descriptor.configurable = !0),
+ "value" in descriptor && (descriptor.writable = !0),
+ Object.defineProperty(target, descriptor.key, descriptor);
+ }
+ }
+ function _createClass(Constructor, protoProps, staticProps) {
+ return (
+ protoProps && _defineProperties(Constructor.prototype, protoProps),
+ staticProps && _defineProperties(Constructor, staticProps),
+ Constructor
+ );
+ }
+ function _possibleConstructorReturn(self, call) {
+ return call && (_typeof(call) === "object" || typeof call == "function")
+ ? call
+ : _assertThisInitialized(self);
+ }
+ function _assertThisInitialized(self) {
+ if (self === void 0)
+ throw new ReferenceError(
+ "this hasn't been initialised - super() hasn't been called"
+ );
+ return self;
+ }
+ function _inherits(subClass, superClass) {
+ if (typeof superClass != "function" && superClass !== null)
+ throw new TypeError(
+ "Super expression must either be null or a function"
+ );
+ (subClass.prototype = Object.create(superClass && superClass.prototype, {
+ constructor: { value: subClass, writable: !0, configurable: !0 },
+ })),
+ superClass && _setPrototypeOf(subClass, superClass);
+ }
+ function _wrapNativeSuper(Class) {
+ var _cache = typeof Map == "function" ? new Map() : void 0;
+ return (
+ (_wrapNativeSuper = function (Class2) {
+ if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
+ if (typeof Class2 != "function")
+ throw new TypeError(
+ "Super expression must either be null or a function"
+ );
+ if (typeof _cache != "undefined") {
+ if (_cache.has(Class2)) return _cache.get(Class2);
+ _cache.set(Class2, Wrapper);
+ }
+ function Wrapper() {
+ return _construct(
+ Class2,
+ arguments,
+ _getPrototypeOf(this).constructor
+ );
+ }
+ return (
+ (Wrapper.prototype = Object.create(Class2.prototype, {
+ constructor: {
+ value: Wrapper,
+ enumerable: !1,
+ writable: !0,
+ configurable: !0,
+ },
+ })),
+ _setPrototypeOf(Wrapper, Class2)
+ );
+ }),
+ _wrapNativeSuper(Class)
+ );
+ }
+ function isNativeReflectConstruct() {
+ if (
+ typeof Reflect == "undefined" ||
+ !Reflect.construct ||
+ Reflect.construct.sham
+ )
+ return !1;
+ if (typeof Proxy == "function") return !0;
+ try {
+ return (
+ Date.prototype.toString.call(
+ Reflect.construct(Date, [], function () {})
+ ),
+ !0
+ );
+ } catch {
+ return !1;
+ }
+ }
+ function _construct(Parent, args, Class) {
+ return (
+ isNativeReflectConstruct()
+ ? (_construct = Reflect.construct)
+ : (_construct = function (Parent2, args2, Class2) {
+ var a = [null];
+ a.push.apply(a, args2);
+ var Constructor = Function.bind.apply(Parent2, a),
+ instance = new Constructor();
+ return (
+ Class2 && _setPrototypeOf(instance, Class2.prototype), instance
+ );
+ }),
+ _construct.apply(null, arguments)
+ );
+ }
+ function _isNativeFunction(fn) {
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
+ }
+ function _setPrototypeOf(o, p) {
+ return (
+ (_setPrototypeOf =
+ Object.setPrototypeOf ||
+ function (o2, p2) {
+ return (o2.__proto__ = p2), o2;
+ }),
+ _setPrototypeOf(o, p)
+ );
+ }
+ function _getPrototypeOf(o) {
+ return (
+ (_getPrototypeOf = Object.setPrototypeOf
+ ? Object.getPrototypeOf
+ : function (o2) {
+ return o2.__proto__ || Object.getPrototypeOf(o2);
+ }),
+ _getPrototypeOf(o)
+ );
+ }
+ function _typeof(obj) {
+ return (
+ typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
+ ? (_typeof = function (obj2) {
+ return typeof obj2;
+ })
+ : (_typeof = function (obj2) {
+ return obj2 &&
+ typeof Symbol == "function" &&
+ obj2.constructor === Symbol &&
+ obj2 !== Symbol.prototype
+ ? "symbol"
+ : typeof obj2;
+ }),
+ _typeof(obj)
+ );
+ }
+ var _require = require("util"),
+ inspect = _require.inspect,
+ _require2 = require_errors(),
+ ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;
+ function endsWith(str, search, this_len) {
+ return (
+ (this_len === void 0 || this_len > str.length) &&
+ (this_len = str.length),
+ str.substring(this_len - search.length, this_len) === search
+ );
+ }
+ function repeat(str, count) {
+ if (((count = Math.floor(count)), str.length == 0 || count == 0))
+ return "";
+ var maxCount = str.length * count;
+ for (count = Math.floor(Math.log(count) / Math.log(2)); count; )
+ (str += str), count--;
+ return (str += str.substring(0, maxCount - str.length)), str;
+ }
+ var blue = "",
+ green = "",
+ red = "",
+ white = "",
+ kReadableOperator = {
+ deepStrictEqual: "Expected values to be strictly deep-equal:",
+ strictEqual: "Expected values to be strictly equal:",
+ strictEqualObject:
+ 'Expected "actual" to be reference-equal to "expected":',
+ deepEqual: "Expected values to be loosely deep-equal:",
+ equal: "Expected values to be loosely equal:",
+ notDeepStrictEqual:
+ 'Expected "actual" not to be strictly deep-equal to:',
+ notStrictEqual: 'Expected "actual" to be strictly unequal to:',
+ notStrictEqualObject:
+ 'Expected "actual" not to be reference-equal to "expected":',
+ notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:',
+ notEqual: 'Expected "actual" to be loosely unequal to:',
+ notIdentical: "Values identical but not reference-equal:",
+ },
+ kMaxShortLength = 10;
+ function copyError(source) {
+ var keys = Object.keys(source),
+ target = Object.create(Object.getPrototypeOf(source));
+ return (
+ keys.forEach(function (key) {
+ target[key] = source[key];
+ }),
+ Object.defineProperty(target, "message", {
+ value: source.message,
+ }),
+ target
+ );
+ }
+ function inspectValue(val) {
+ return inspect(val, {
+ compact: !1,
+ customInspect: !1,
+ depth: 1e3,
+ maxArrayLength: 1 / 0,
+ showHidden: !1,
+ breakLength: 1 / 0,
+ showProxy: !1,
+ sorted: !0,
+ getters: !0,
+ });
+ }
+ function createErrDiff(actual, expected, operator) {
+ var other = "",
+ res = "",
+ lastPos = 0,
+ end = "",
+ skipped = !1,
+ actualInspected = inspectValue(actual),
+ actualLines = actualInspected.split(`
+`),
+ expectedLines = inspectValue(expected).split(`
+`),
+ i = 0,
+ indicator = "";
+ if (
+ (operator === "strictEqual" &&
+ _typeof(actual) === "object" &&
+ _typeof(expected) === "object" &&
+ actual !== null &&
+ expected !== null &&
+ (operator = "strictEqualObject"),
+ actualLines.length === 1 &&
+ expectedLines.length === 1 &&
+ actualLines[0] !== expectedLines[0])
+ ) {
+ var inputLength = actualLines[0].length + expectedLines[0].length;
+ if (inputLength <= kMaxShortLength) {
+ if (
+ (_typeof(actual) !== "object" || actual === null) &&
+ (_typeof(expected) !== "object" || expected === null) &&
+ (actual !== 0 || expected !== 0)
+ )
+ return (
+ "".concat(
+ kReadableOperator[operator],
+ `
+
+`
+ ) +
+ "".concat(actualLines[0], " !== ").concat(
+ expectedLines[0],
+ `
+`
+ )
+ );
+ } else if (operator !== "strictEqualObject") {
+ var maxLength =
+ process.stderr && process.stderr.isTTY
+ ? process.stderr.columns
+ : 80;
+ if (inputLength < maxLength) {
+ for (; actualLines[0][i] === expectedLines[0][i]; ) i++;
+ i > 2 &&
+ ((indicator = `
+ `.concat(repeat(" ", i), "^")),
+ (i = 0));
+ }
+ }
+ }
+ for (
+ var a = actualLines[actualLines.length - 1],
+ b = expectedLines[expectedLines.length - 1];
+ a === b &&
+ (i++ < 2
+ ? (end = `
+ `
+ .concat(a)
+ .concat(end))
+ : (other = a),
+ actualLines.pop(),
+ expectedLines.pop(),
+ !(actualLines.length === 0 || expectedLines.length === 0));
+
+ )
+ (a = actualLines[actualLines.length - 1]),
+ (b = expectedLines[expectedLines.length - 1]);
+ var maxLines = Math.max(actualLines.length, expectedLines.length);
+ if (maxLines === 0) {
+ var _actualLines = actualInspected.split(`
+`);
+ if (_actualLines.length > 30)
+ for (
+ _actualLines[26] = "".concat(blue, "...").concat(white);
+ _actualLines.length > 27;
+
+ )
+ _actualLines.pop();
+ return ""
+ .concat(
+ kReadableOperator.notIdentical,
+ `
+
+`
+ )
+ .concat(
+ _actualLines.join(`
+`),
+ `
+`
+ );
+ }
+ i > 3 &&
+ ((end = `
+`
+ .concat(blue, "...")
+ .concat(white)
+ .concat(end)),
+ (skipped = !0)),
+ other !== "" &&
+ ((end = `
+ `
+ .concat(other)
+ .concat(end)),
+ (other = ""));
+ var printedLines = 0,
+ msg =
+ kReadableOperator[operator] +
+ `
+`
+ .concat(green, "+ actual")
+ .concat(white, " ")
+ .concat(red, "- expected")
+ .concat(white),
+ skippedMsg = " ".concat(blue, "...").concat(white, " Lines skipped");
+ for (i = 0; i < maxLines; i++) {
+ var cur = i - lastPos;
+ if (actualLines.length < i + 1)
+ cur > 1 &&
+ i > 2 &&
+ (cur > 4
+ ? ((res += `
+`
+ .concat(blue, "...")
+ .concat(white)),
+ (skipped = !0))
+ : cur > 3 &&
+ ((res += `
+ `.concat(expectedLines[i - 2])),
+ printedLines++),
+ (res += `
+ `.concat(expectedLines[i - 1])),
+ printedLines++),
+ (lastPos = i),
+ (other += `
+`
+ .concat(red, "-")
+ .concat(white, " ")
+ .concat(expectedLines[i])),
+ printedLines++;
+ else if (expectedLines.length < i + 1)
+ cur > 1 &&
+ i > 2 &&
+ (cur > 4
+ ? ((res += `
+`
+ .concat(blue, "...")
+ .concat(white)),
+ (skipped = !0))
+ : cur > 3 &&
+ ((res += `
+ `.concat(actualLines[i - 2])),
+ printedLines++),
+ (res += `
+ `.concat(actualLines[i - 1])),
+ printedLines++),
+ (lastPos = i),
+ (res += `
+`
+ .concat(green, "+")
+ .concat(white, " ")
+ .concat(actualLines[i])),
+ printedLines++;
+ else {
+ var expectedLine = expectedLines[i],
+ actualLine = actualLines[i],
+ divergingLines =
+ actualLine !== expectedLine &&
+ (!endsWith(actualLine, ",") ||
+ actualLine.slice(0, -1) !== expectedLine);
+ divergingLines &&
+ endsWith(expectedLine, ",") &&
+ expectedLine.slice(0, -1) === actualLine &&
+ ((divergingLines = !1), (actualLine += ",")),
+ divergingLines
+ ? (cur > 1 &&
+ i > 2 &&
+ (cur > 4
+ ? ((res += `
+`
+ .concat(blue, "...")
+ .concat(white)),
+ (skipped = !0))
+ : cur > 3 &&
+ ((res += `
+ `.concat(actualLines[i - 2])),
+ printedLines++),
+ (res += `
+ `.concat(actualLines[i - 1])),
+ printedLines++),
+ (lastPos = i),
+ (res += `
+`
+ .concat(green, "+")
+ .concat(white, " ")
+ .concat(actualLine)),
+ (other += `
+`
+ .concat(red, "-")
+ .concat(white, " ")
+ .concat(expectedLine)),
+ (printedLines += 2))
+ : ((res += other),
+ (other = ""),
+ (cur === 1 || i === 0) &&
+ ((res += `
+ `.concat(actualLine)),
+ printedLines++));
+ }
+ if (printedLines > 20 && i < maxLines - 2)
+ return (
+ ""
+ .concat(msg)
+ .concat(
+ skippedMsg,
+ `
+`
+ )
+ .concat(
+ res,
+ `
+`
+ )
+ .concat(blue, "...")
+ .concat(white)
+ .concat(
+ other,
+ `
+`
+ ) + "".concat(blue, "...").concat(white)
+ );
+ }
+ return ""
+ .concat(msg)
+ .concat(
+ skipped ? skippedMsg : "",
+ `
+`
+ )
+ .concat(res)
+ .concat(other)
+ .concat(end)
+ .concat(indicator);
+ }
+ var AssertionError = /* @__PURE__ */ (function (_Error) {
+ _inherits(AssertionError2, _Error);
+ function AssertionError2(options) {
+ var _this;
+ if (
+ (_classCallCheck(this, AssertionError2),
+ _typeof(options) !== "object" || options === null)
+ )
+ throw new ERR_INVALID_ARG_TYPE("options", "Object", options);
+ var message = options.message,
+ operator = options.operator,
+ stackStartFn = options.stackStartFn,
+ actual = options.actual,
+ expected = options.expected,
+ limit = Error.stackTraceLimit;
+ if (((Error.stackTraceLimit = 0), message != null))
+ _this = _possibleConstructorReturn(
+ this,
+ _getPrototypeOf(AssertionError2).call(this, String(message))
+ );
+ else if (
+ (process.stderr &&
+ process.stderr.isTTY &&
+ (process.stderr &&
+ process.stderr.getColorDepth &&
+ process.stderr.getColorDepth() !== 1
+ ? ((blue = ""), (green = ""), (white = ""), (red = ""))
+ : ((blue = ""), (green = ""), (white = ""), (red = ""))),
+ _typeof(actual) === "object" &&
+ actual !== null &&
+ _typeof(expected) === "object" &&
+ expected !== null &&
+ "stack" in actual &&
+ actual instanceof Error &&
+ "stack" in expected &&
+ expected instanceof Error &&
+ ((actual = copyError(actual)), (expected = copyError(expected))),
+ operator === "deepStrictEqual" || operator === "strictEqual")
+ )
+ _this = _possibleConstructorReturn(
+ this,
+ _getPrototypeOf(AssertionError2).call(
+ this,
+ createErrDiff(actual, expected, operator)
+ )
+ );
+ else if (
+ operator === "notDeepStrictEqual" ||
+ operator === "notStrictEqual"
+ ) {
+ var base = kReadableOperator[operator],
+ res = inspectValue(actual).split(`
+`);
+ if (
+ (operator === "notStrictEqual" &&
+ _typeof(actual) === "object" &&
+ actual !== null &&
+ (base = kReadableOperator.notStrictEqualObject),
+ res.length > 30)
+ )
+ for (
+ res[26] = "".concat(blue, "...").concat(white);
+ res.length > 27;
+
+ )
+ res.pop();
+ res.length === 1
+ ? (_this = _possibleConstructorReturn(
+ this,
+ _getPrototypeOf(AssertionError2).call(
+ this,
+ "".concat(base, " ").concat(res[0])
+ )
+ ))
+ : (_this = _possibleConstructorReturn(
+ this,
+ _getPrototypeOf(AssertionError2).call(
+ this,
+ ""
+ .concat(
+ base,
+ `
+
+`
+ )
+ .concat(
+ res.join(`
+`),
+ `
+`
+ )
+ )
+ ));
+ } else {
+ var _res = inspectValue(actual),
+ other = "",
+ knownOperators = kReadableOperator[operator];
+ operator === "notDeepEqual" || operator === "notEqual"
+ ? ((_res = ""
+ .concat(
+ kReadableOperator[operator],
+ `
+
+`
+ )
+ .concat(_res)),
+ _res.length > 1024 &&
+ (_res = "".concat(_res.slice(0, 1021), "...")))
+ : ((other = "".concat(inspectValue(expected))),
+ _res.length > 512 &&
+ (_res = "".concat(_res.slice(0, 509), "...")),
+ other.length > 512 &&
+ (other = "".concat(other.slice(0, 509), "...")),
+ operator === "deepEqual" || operator === "equal"
+ ? (_res = ""
+ .concat(
+ knownOperators,
+ `
+
+`
+ )
+ .concat(
+ _res,
+ `
+
+should equal
+
+`
+ ))
+ : (other = " ".concat(operator, " ").concat(other))),
+ (_this = _possibleConstructorReturn(
+ this,
+ _getPrototypeOf(AssertionError2).call(
+ this,
+ "".concat(_res).concat(other)
+ )
+ ));
+ }
+ return (
+ (Error.stackTraceLimit = limit),
+ (_this.generatedMessage = !message),
+ Object.defineProperty(_assertThisInitialized(_this), "name", {
+ value: "AssertionError [ERR_ASSERTION]",
+ enumerable: !1,
+ writable: !0,
+ configurable: !0,
+ }),
+ (_this.code = "ERR_ASSERTION"),
+ (_this.actual = actual),
+ (_this.expected = expected),
+ (_this.operator = operator),
+ Error.captureStackTrace &&
+ Error.captureStackTrace(
+ _assertThisInitialized(_this),
+ stackStartFn
+ ),
+ _this.stack,
+ (_this.name = "AssertionError"),
+ _possibleConstructorReturn(_this)
+ );
+ }
+ return (
+ _createClass(AssertionError2, [
+ {
+ key: "toString",
+ value: function () {
+ return ""
+ .concat(this.name, " [")
+ .concat(this.code, "]: ")
+ .concat(this.message);
+ },
+ },
+ {
+ key: inspect.custom,
+ value: function (recurseTimes, ctx) {
+ return inspect(
+ this,
+ _objectSpread({}, ctx, {
+ customInspect: !1,
+ depth: 0,
+ })
+ );
+ },
+ },
+ ]),
+ AssertionError2
+ );
+ })(_wrapNativeSuper(Error));
+ module2.exports = AssertionError;
+ },
+});
+
+// es6-object-assign/index.js
+var require_es6_object_assign = __commonJS({
+ "es6-object-assign/index.js"(exports, module2) {
+ "use strict";
+ function assign(target, firstSource) {
+ if (target == null)
+ throw new TypeError("Cannot convert first argument to object");
+ for (var to = Object(target), i = 1; i < arguments.length; i++) {
+ var nextSource = arguments[i];
+ if (nextSource != null)
+ for (
+ var keysArray = Object.keys(Object(nextSource)),
+ nextIndex = 0,
+ len = keysArray.length;
+ nextIndex < len;
+ nextIndex++
+ ) {
+ var nextKey = keysArray[nextIndex],
+ desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
+ desc !== void 0 &&
+ desc.enumerable &&
+ (to[nextKey] = nextSource[nextKey]);
+ }
+ }
+ return to;
+ }
+ function polyfill() {
+ Object.assign ||
+ Object.defineProperty(Object, "assign", {
+ enumerable: !1,
+ configurable: !0,
+ writable: !0,
+ value: assign,
+ });
+ }
+ module2.exports = {
+ assign,
+ polyfill,
+ };
+ },
+});
+
+// object-keys/isArguments.js
+var require_isArguments = __commonJS({
+ "object-keys/isArguments.js"(exports, module2) {
+ "use strict";
+ var toStr = Object.prototype.toString;
+ module2.exports = function (value) {
+ var str = toStr.call(value),
+ isArgs = str === "[object Arguments]";
+ return (
+ isArgs ||
+ (isArgs =
+ str !== "[object Array]" &&
+ value !== null &&
+ typeof value == "object" &&
+ typeof value.length == "number" &&
+ value.length >= 0 &&
+ toStr.call(value.callee) === "[object Function]"),
+ isArgs
+ );
+ };
+ },
+});
+
+// object-keys/implementation.js
+var require_implementation = __commonJS({
+ "object-keys/implementation.js"(exports, module2) {
+ "use strict";
+ var keysShim;
+ Object.keys ||
+ ((has = Object.prototype.hasOwnProperty),
+ (toStr = Object.prototype.toString),
+ (isArgs = require_isArguments()),
+ (isEnumerable = Object.prototype.propertyIsEnumerable),
+ (hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString")),
+ (hasProtoEnumBug = isEnumerable.call(function () {}, "prototype")),
+ (dontEnums = [
+ "toString",
+ "toLocaleString",
+ "valueOf",
+ "hasOwnProperty",
+ "isPrototypeOf",
+ "propertyIsEnumerable",
+ "constructor",
+ ]),
+ (equalsConstructorPrototype = function (o) {
+ var ctor = o.constructor;
+ return ctor && ctor.prototype === o;
+ }),
+ (excludedKeys = {
+ $applicationCache: !0,
+ $console: !0,
+ $external: !0,
+ $frame: !0,
+ $frameElement: !0,
+ $frames: !0,
+ $innerHeight: !0,
+ $innerWidth: !0,
+ $onmozfullscreenchange: !0,
+ $onmozfullscreenerror: !0,
+ $outerHeight: !0,
+ $outerWidth: !0,
+ $pageXOffset: !0,
+ $pageYOffset: !0,
+ $parent: !0,
+ $scrollLeft: !0,
+ $scrollTop: !0,
+ $scrollX: !0,
+ $scrollY: !0,
+ $self: !0,
+ $webkitIndexedDB: !0,
+ $webkitStorageInfo: !0,
+ $window: !0,
+ }),
+ (hasAutomationEqualityBug = (function () {
+ if (typeof window == "undefined") return !1;
+ for (var k in window)
+ try {
+ if (
+ !excludedKeys["$" + k] &&
+ has.call(window, k) &&
+ window[k] !== null &&
+ typeof window[k] == "object"
+ )
+ try {
+ equalsConstructorPrototype(window[k]);
+ } catch {
+ return !0;
+ }
+ } catch {
+ return !0;
+ }
+ return !1;
+ })()),
+ (equalsConstructorPrototypeIfNotBuggy = function (o) {
+ if (typeof window == "undefined" || !hasAutomationEqualityBug)
+ return equalsConstructorPrototype(o);
+ try {
+ return equalsConstructorPrototype(o);
+ } catch {
+ return !1;
+ }
+ }),
+ (keysShim = function (object) {
+ var isObject = object !== null && typeof object == "object",
+ isFunction = toStr.call(object) === "[object Function]",
+ isArguments = isArgs(object),
+ isString = isObject && toStr.call(object) === "[object String]",
+ theKeys = [];
+ if (!isObject && !isFunction && !isArguments)
+ throw new TypeError("Object.keys called on a non-object");
+ var skipProto = hasProtoEnumBug && isFunction;
+ if (isString && object.length > 0 && !has.call(object, 0))
+ for (var i = 0; i < object.length; ++i) theKeys.push(String(i));
+ if (isArguments && object.length > 0)
+ for (var j = 0; j < object.length; ++j) theKeys.push(String(j));
+ else
+ for (var name in object)
+ !(skipProto && name === "prototype") &&
+ has.call(object, name) &&
+ theKeys.push(String(name));
+ if (hasDontEnumBug)
+ for (
+ var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object),
+ k = 0;
+ k < dontEnums.length;
+ ++k
+ )
+ !(skipConstructor && dontEnums[k] === "constructor") &&
+ has.call(object, dontEnums[k]) &&
+ theKeys.push(dontEnums[k]);
+ return theKeys;
+ }));
+ var has,
+ toStr,
+ isArgs,
+ isEnumerable,
+ hasDontEnumBug,
+ hasProtoEnumBug,
+ dontEnums,
+ equalsConstructorPrototype,
+ excludedKeys,
+ hasAutomationEqualityBug,
+ equalsConstructorPrototypeIfNotBuggy;
+ module2.exports = keysShim;
+ },
+});
+
+// object-keys/index.js
+var require_object_keys = __commonJS({
+ "object-keys/index.js"(exports, module2) {
+ "use strict";
+ var slice = Array.prototype.slice,
+ isArgs = require_isArguments(),
+ origKeys = Object.keys,
+ keysShim = origKeys
+ ? function (o) {
+ return origKeys(o);
+ }
+ : require_implementation(),
+ originalKeys = Object.keys;
+ keysShim.shim = function () {
+ if (Object.keys) {
+ var keysWorksWithArguments = (function () {
+ var args = Object.keys(arguments);
+ return args && args.length === arguments.length;
+ })(1, 2);
+ keysWorksWithArguments ||
+ (Object.keys = function (object) {
+ return isArgs(object)
+ ? originalKeys(slice.call(object))
+ : originalKeys(object);
+ });
+ } else Object.keys = keysShim;
+ return Object.keys || keysShim;
+ };
+ module2.exports = keysShim;
+ },
+});
+
+// has-symbols/shams.js
+var require_shams = __commonJS({
+ "has-symbols/shams.js"(exports, module2) {
+ "use strict";
+ module2.exports = function () {
+ if (
+ typeof Symbol != "function" ||
+ typeof Object.getOwnPropertySymbols != "function"
+ )
+ return !1;
+ if (typeof Symbol.iterator == "symbol") return !0;
+ var obj = {},
+ sym = Symbol("test"),
+ symObj = Object(sym);
+ if (
+ typeof sym == "string" ||
+ Object.prototype.toString.call(sym) !== "[object Symbol]" ||
+ Object.prototype.toString.call(symObj) !== "[object Symbol]"
+ )
+ return !1;
+ var symVal = 42;
+ obj[sym] = symVal;
+ for (sym in obj) return !1;
+ if (
+ (typeof Object.keys == "function" && Object.keys(obj).length !== 0) ||
+ (typeof Object.getOwnPropertyNames == "function" &&
+ Object.getOwnPropertyNames(obj).length !== 0)
+ )
+ return !1;
+ var syms = Object.getOwnPropertySymbols(obj);
+ if (
+ syms.length !== 1 ||
+ syms[0] !== sym ||
+ !Object.prototype.propertyIsEnumerable.call(obj, sym)
+ )
+ return !1;
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
+ if (descriptor.value !== symVal || descriptor.enumerable !== !0)
+ return !1;
+ }
+ return !0;
+ };
+ },
+});
+
+// has-symbols/index.js
+var require_has_symbols = __commonJS({
+ "has-symbols/index.js"(exports, module2) {
+ "use strict";
+ var origSymbol = typeof Symbol != "undefined" && Symbol,
+ hasSymbolSham = require_shams();
+ module2.exports = function () {
+ return typeof origSymbol != "function" ||
+ typeof Symbol != "function" ||
+ typeof origSymbol("foo") != "symbol" ||
+ typeof Symbol("bar") != "symbol"
+ ? !1
+ : hasSymbolSham();
+ };
+ },
+});
+
+// function-bind/implementation.js
+var require_implementation2 = __commonJS({
+ "function-bind/implementation.js"(exports, module2) {
+ "use strict";
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ",
+ slice = Array.prototype.slice,
+ toStr = Object.prototype.toString,
+ funcType = "[object Function]";
+ module2.exports = function (that) {
+ var target = this;
+ if (typeof target != "function" || toStr.call(target) !== funcType)
+ throw new TypeError(ERROR_MESSAGE + target);
+ for (
+ var args = slice.call(arguments, 1),
+ bound,
+ binder = function () {
+ if (this instanceof bound) {
+ var result = target.apply(
+ this,
+ args.concat(slice.call(arguments))
+ );
+ return Object(result) === result ? result : this;
+ } else
+ return target.apply(that, args.concat(slice.call(arguments)));
+ },
+ boundLength = Math.max(0, target.length - args.length),
+ boundArgs = [],
+ i = 0;
+ i < boundLength;
+ i++
+ )
+ boundArgs.push("$" + i);
+ if (
+ ((bound = Function(
+ "binder",
+ "return function (" +
+ boundArgs.join(",") +
+ "){ return binder.apply(this,arguments); }"
+ )(binder)),
+ target.prototype)
+ ) {
+ var Empty = function () {};
+ (Empty.prototype = target.prototype),
+ (bound.prototype = new Empty()),
+ (Empty.prototype = null);
+ }
+ return bound;
+ };
+ },
+});
+
+// function-bind/index.js
+var require_function_bind = __commonJS({
+ "function-bind/index.js"(exports, module2) {
+ "use strict";
+ var implementation = require_implementation2();
+ module2.exports = Function.prototype.bind || implementation;
+ },
+});
+
+// has/src/index.js
+var require_src = __commonJS({
+ "has/src/index.js"(exports, module2) {
+ "use strict";
+ var bind = require_function_bind();
+ module2.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
+ },
+});
+
+// get-intrinsic/index.js
+var require_get_intrinsic = __commonJS({
+ "get-intrinsic/index.js"(exports, module2) {
+ "use strict";
+ var undefined2,
+ $SyntaxError = SyntaxError,
+ $Function = Function,
+ $TypeError = TypeError,
+ getEvalledConstructor = function (expressionSyntax) {
+ try {
+ return $Function(
+ '"use strict"; return (' + expressionSyntax + ").constructor;"
+ )();
+ } catch {}
+ },
+ $gOPD = Object.getOwnPropertyDescriptor;
+ if ($gOPD)
+ try {
+ $gOPD({}, "");
+ } catch {
+ $gOPD = null;
+ }
+ var throwTypeError = function () {
+ throw new $TypeError();
+ },
+ ThrowTypeError = $gOPD
+ ? (function () {
+ try {
+ return arguments.callee, throwTypeError;
+ } catch {
+ try {
+ return $gOPD(arguments, "callee").get;
+ } catch {
+ return throwTypeError;
+ }
+ }
+ })()
+ : throwTypeError,
+ hasSymbols = require_has_symbols()(),
+ getProto =
+ Object.getPrototypeOf ||
+ function (x) {
+ return x.__proto__;
+ },
+ needsEval = {},
+ TypedArray =
+ typeof Uint8Array == "undefined" ? undefined2 : getProto(Uint8Array),
+ INTRINSICS = {
+ "%AggregateError%":
+ typeof AggregateError == "undefined" ? undefined2 : AggregateError,
+ "%Array%": Array,
+ "%ArrayBuffer%":
+ typeof ArrayBuffer == "undefined" ? undefined2 : ArrayBuffer,
+ "%ArrayIteratorPrototype%": hasSymbols
+ ? getProto([][Symbol.iterator]())
+ : undefined2,
+ "%AsyncFromSyncIteratorPrototype%": undefined2,
+ "%AsyncFunction%": needsEval,
+ "%AsyncGenerator%": needsEval,
+ "%AsyncGeneratorFunction%": needsEval,
+ "%AsyncIteratorPrototype%": needsEval,
+ "%Atomics%": typeof Atomics == "undefined" ? undefined2 : Atomics,
+ "%BigInt%": typeof BigInt == "undefined" ? undefined2 : BigInt,
+ "%Boolean%": Boolean,
+ "%DataView%": typeof DataView == "undefined" ? undefined2 : DataView,
+ "%Date%": Date,
+ "%decodeURI%": decodeURI,
+ "%decodeURIComponent%": decodeURIComponent,
+ "%encodeURI%": encodeURI,
+ "%encodeURIComponent%": encodeURIComponent,
+ "%Error%": Error,
+ "%eval%": eval,
+ "%EvalError%": EvalError,
+ "%Float32Array%":
+ typeof Float32Array == "undefined" ? undefined2 : Float32Array,
+ "%Float64Array%":
+ typeof Float64Array == "undefined" ? undefined2 : Float64Array,
+ "%FinalizationRegistry%":
+ typeof FinalizationRegistry == "undefined"
+ ? undefined2
+ : FinalizationRegistry,
+ "%Function%": $Function,
+ "%GeneratorFunction%": needsEval,
+ "%Int8Array%": typeof Int8Array == "undefined" ? undefined2 : Int8Array,
+ "%Int16Array%":
+ typeof Int16Array == "undefined" ? undefined2 : Int16Array,
+ "%Int32Array%":
+ typeof Int32Array == "undefined" ? undefined2 : Int32Array,
+ "%isFinite%": isFinite,
+ "%isNaN%": isNaN,
+ "%IteratorPrototype%": hasSymbols
+ ? getProto(getProto([][Symbol.iterator]()))
+ : undefined2,
+ "%JSON%": typeof JSON == "object" ? JSON : undefined2,
+ "%Map%": typeof Map == "undefined" ? undefined2 : Map,
+ "%MapIteratorPrototype%":
+ typeof Map == "undefined" || !hasSymbols
+ ? undefined2
+ : getProto(new Map()[Symbol.iterator]()),
+ "%Math%": Math,
+ "%Number%": Number,
+ "%Object%": Object,
+ "%parseFloat%": parseFloat,
+ "%parseInt%": parseInt,
+ "%Promise%": typeof Promise == "undefined" ? undefined2 : Promise,
+ "%Proxy%": typeof Proxy == "undefined" ? undefined2 : Proxy,
+ "%RangeError%": RangeError,
+ "%ReferenceError%": ReferenceError,
+ "%Reflect%": typeof Reflect == "undefined" ? undefined2 : Reflect,
+ "%RegExp%": RegExp,
+ "%Set%": typeof Set == "undefined" ? undefined2 : Set,
+ "%SetIteratorPrototype%":
+ typeof Set == "undefined" || !hasSymbols
+ ? undefined2
+ : getProto(new Set()[Symbol.iterator]()),
+ "%SharedArrayBuffer%":
+ typeof SharedArrayBuffer == "undefined"
+ ? undefined2
+ : SharedArrayBuffer,
+ "%String%": String,
+ "%StringIteratorPrototype%": hasSymbols
+ ? getProto(""[Symbol.iterator]())
+ : undefined2,
+ "%Symbol%": hasSymbols ? Symbol : undefined2,
+ "%SyntaxError%": $SyntaxError,
+ "%ThrowTypeError%": ThrowTypeError,
+ "%TypedArray%": TypedArray,
+ "%TypeError%": $TypeError,
+ "%Uint8Array%":
+ typeof Uint8Array == "undefined" ? undefined2 : Uint8Array,
+ "%Uint8ClampedArray%":
+ typeof Uint8ClampedArray == "undefined"
+ ? undefined2
+ : Uint8ClampedArray,
+ "%Uint16Array%":
+ typeof Uint16Array == "undefined" ? undefined2 : Uint16Array,
+ "%Uint32Array%":
+ typeof Uint32Array == "undefined" ? undefined2 : Uint32Array,
+ "%URIError%": URIError,
+ "%WeakMap%": typeof WeakMap == "undefined" ? undefined2 : WeakMap,
+ "%WeakRef%": typeof WeakRef == "undefined" ? undefined2 : WeakRef,
+ "%WeakSet%": typeof WeakSet == "undefined" ? undefined2 : WeakSet,
+ },
+ doEval = function doEval2(name) {
+ var value;
+ if (name === "%AsyncFunction%")
+ value = getEvalledConstructor("async function () {}");
+ else if (name === "%GeneratorFunction%")
+ value = getEvalledConstructor("function* () {}");
+ else if (name === "%AsyncGeneratorFunction%")
+ value = getEvalledConstructor("async function* () {}");
+ else if (name === "%AsyncGenerator%") {
+ var fn = doEval2("%AsyncGeneratorFunction%");
+ fn && (value = fn.prototype);
+ } else if (name === "%AsyncIteratorPrototype%") {
+ var gen = doEval2("%AsyncGenerator%");
+ gen && (value = getProto(gen.prototype));
+ }
+ return (INTRINSICS[name] = value), value;
+ },
+ LEGACY_ALIASES = {
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
+ "%ArrayPrototype%": ["Array", "prototype"],
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
+ "%AsyncGeneratorPrototype%": [
+ "AsyncGeneratorFunction",
+ "prototype",
+ "prototype",
+ ],
+ "%BooleanPrototype%": ["Boolean", "prototype"],
+ "%DataViewPrototype%": ["DataView", "prototype"],
+ "%DatePrototype%": ["Date", "prototype"],
+ "%ErrorPrototype%": ["Error", "prototype"],
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
+ "%FunctionPrototype%": ["Function", "prototype"],
+ "%Generator%": ["GeneratorFunction", "prototype"],
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
+ "%JSONParse%": ["JSON", "parse"],
+ "%JSONStringify%": ["JSON", "stringify"],
+ "%MapPrototype%": ["Map", "prototype"],
+ "%NumberPrototype%": ["Number", "prototype"],
+ "%ObjectPrototype%": ["Object", "prototype"],
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
+ "%PromisePrototype%": ["Promise", "prototype"],
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
+ "%Promise_all%": ["Promise", "all"],
+ "%Promise_reject%": ["Promise", "reject"],
+ "%Promise_resolve%": ["Promise", "resolve"],
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
+ "%RegExpPrototype%": ["RegExp", "prototype"],
+ "%SetPrototype%": ["Set", "prototype"],
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
+ "%StringPrototype%": ["String", "prototype"],
+ "%SymbolPrototype%": ["Symbol", "prototype"],
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
+ "%URIErrorPrototype%": ["URIError", "prototype"],
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
+ "%WeakSetPrototype%": ["WeakSet", "prototype"],
+ },
+ bind = require_function_bind(),
+ hasOwn = require_src(),
+ $concat = bind.call(Function.call, Array.prototype.concat),
+ $spliceApply = bind.call(Function.apply, Array.prototype.splice),
+ $replace = bind.call(Function.call, String.prototype.replace),
+ $strSlice = bind.call(Function.call, String.prototype.slice),
+ $exec = bind.call(Function.call, RegExp.prototype.exec),
+ rePropName =
+ /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,
+ reEscapeChar = /\\(\\)?/g,
+ stringToPath = function (string) {
+ var first = $strSlice(string, 0, 1),
+ last = $strSlice(string, -1);
+ if (first === "%" && last !== "%")
+ throw new $SyntaxError(
+ "invalid intrinsic syntax, expected closing `%`"
+ );
+ if (last === "%" && first !== "%")
+ throw new $SyntaxError(
+ "invalid intrinsic syntax, expected opening `%`"
+ );
+ var result = [];
+ return (
+ $replace(
+ string,
+ rePropName,
+ function (match, number, quote, subString) {
+ result[result.length] = quote
+ ? $replace(subString, reEscapeChar, "$1")
+ : number || match;
+ }
+ ),
+ result
+ );
+ },
+ getBaseIntrinsic = function (name, allowMissing) {
+ var intrinsicName = name,
+ alias;
+ if (
+ (hasOwn(LEGACY_ALIASES, intrinsicName) &&
+ ((alias = LEGACY_ALIASES[intrinsicName]),
+ (intrinsicName = "%" + alias[0] + "%")),
+ hasOwn(INTRINSICS, intrinsicName))
+ ) {
+ var value = INTRINSICS[intrinsicName];
+ if (
+ (value === needsEval && (value = doEval(intrinsicName)),
+ typeof value == "undefined" && !allowMissing)
+ )
+ throw new $TypeError(
+ "intrinsic " +
+ name +
+ " exists, but is not available. Please file an issue!"
+ );
+ return {
+ alias,
+ name: intrinsicName,
+ value,
+ };
+ }
+ throw new $SyntaxError("intrinsic " + name + " does not exist!");
+ };
+ module2.exports = function (name, allowMissing) {
+ if (typeof name != "string" || name.length === 0)
+ throw new $TypeError("intrinsic name must be a non-empty string");
+ if (arguments.length > 1 && typeof allowMissing != "boolean")
+ throw new $TypeError('"allowMissing" argument must be a boolean');
+ if ($exec(/^%?[^%]*%?$/g, name) === null)
+ throw new $SyntaxError(
+ "`%` may not be present anywhere but at the beginning and end of the intrinsic name"
+ );
+ var parts = stringToPath(name),
+ intrinsicBaseName = parts.length > 0 ? parts[0] : "",
+ intrinsic = getBaseIntrinsic(
+ "%" + intrinsicBaseName + "%",
+ allowMissing
+ ),
+ intrinsicRealName = intrinsic.name,
+ value = intrinsic.value,
+ skipFurtherCaching = !1,
+ alias = intrinsic.alias;
+ alias &&
+ ((intrinsicBaseName = alias[0]),
+ $spliceApply(parts, $concat([0, 1], alias)));
+ for (var i = 1, isOwn = !0; i < parts.length; i += 1) {
+ var part = parts[i],
+ first = $strSlice(part, 0, 1),
+ last = $strSlice(part, -1);
+ if (
+ (first === '"' ||
+ first === "'" ||
+ first === "`" ||
+ last === '"' ||
+ last === "'" ||
+ last === "`") &&
+ first !== last
+ )
+ throw new $SyntaxError(
+ "property names with quotes must have matching quotes"
+ );
+ if (
+ ((part === "constructor" || !isOwn) && (skipFurtherCaching = !0),
+ (intrinsicBaseName += "." + part),
+ (intrinsicRealName = "%" + intrinsicBaseName + "%"),
+ hasOwn(INTRINSICS, intrinsicRealName))
+ )
+ value = INTRINSICS[intrinsicRealName];
+ else if (value != null) {
+ if (!(part in value)) {
+ if (!allowMissing)
+ throw new $TypeError(
+ "base intrinsic for " +
+ name +
+ " exists, but the property is not available."
+ );
+ return;
+ }
+ if ($gOPD && i + 1 >= parts.length) {
+ var desc = $gOPD(value, part);
+ (isOwn = !!desc),
+ isOwn && "get" in desc && !("originalValue" in desc.get)
+ ? (value = desc.get)
+ : (value = value[part]);
+ } else (isOwn = hasOwn(value, part)), (value = value[part]);
+ isOwn &&
+ !skipFurtherCaching &&
+ (INTRINSICS[intrinsicRealName] = value);
+ }
+ }
+ return value;
+ };
+ },
+});
+
+// has-property-descriptors/index.js
+var require_has_property_descriptors = __commonJS({
+ "has-property-descriptors/index.js"(exports, module2) {
+ "use strict";
+ var GetIntrinsic = require_get_intrinsic(),
+ $defineProperty = GetIntrinsic("%Object.defineProperty%", !0),
+ hasPropertyDescriptors = function () {
+ if ($defineProperty)
+ try {
+ return $defineProperty({}, "a", { value: 1 }), !0;
+ } catch {
+ return !1;
+ }
+ return !1;
+ };
+ hasPropertyDescriptors.hasArrayLengthDefineBug = function () {
+ if (!hasPropertyDescriptors()) return null;
+ try {
+ return $defineProperty([], "length", { value: 1 }).length !== 1;
+ } catch {
+ return !0;
+ }
+ };
+ module2.exports = hasPropertyDescriptors;
+ },
+});
+
+// define-properties/index.js
+var require_define_properties = __commonJS({
+ "define-properties/index.js"(exports, module2) {
+ "use strict";
+ var keys = require_object_keys(),
+ hasSymbols =
+ typeof Symbol == "function" && typeof Symbol("foo") == "symbol",
+ toStr = Object.prototype.toString,
+ concat = Array.prototype.concat,
+ origDefineProperty = Object.defineProperty,
+ isFunction = function (fn) {
+ return (
+ typeof fn == "function" && toStr.call(fn) === "[object Function]"
+ );
+ },
+ hasPropertyDescriptors = require_has_property_descriptors()(),
+ supportsDescriptors = origDefineProperty && hasPropertyDescriptors,
+ defineProperty = function (object, name, value, predicate) {
+ (name in object && (!isFunction(predicate) || !predicate())) ||
+ (supportsDescriptors
+ ? origDefineProperty(object, name, {
+ configurable: !0,
+ enumerable: !1,
+ value,
+ writable: !0,
+ })
+ : (object[name] = value));
+ },
+ defineProperties = function (object, map) {
+ var predicates = arguments.length > 2 ? arguments[2] : {},
+ props = keys(map);
+ hasSymbols &&
+ (props = concat.call(props, Object.getOwnPropertySymbols(map)));
+ for (var i = 0; i < props.length; i += 1)
+ defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
+ };
+ defineProperties.supportsDescriptors = !!supportsDescriptors;
+ module2.exports = defineProperties;
+ },
+});
+
+// call-bind/index.js
+var require_call_bind = __commonJS({
+ "call-bind/index.js"(exports, module2) {
+ "use strict";
+ var bind = require_function_bind(),
+ GetIntrinsic = require_get_intrinsic(),
+ $apply = GetIntrinsic("%Function.prototype.apply%"),
+ $call = GetIntrinsic("%Function.prototype.call%"),
+ $reflectApply =
+ GetIntrinsic("%Reflect.apply%", !0) || bind.call($call, $apply),
+ $gOPD = GetIntrinsic("%Object.getOwnPropertyDescriptor%", !0),
+ $defineProperty = GetIntrinsic("%Object.defineProperty%", !0),
+ $max = GetIntrinsic("%Math.max%");
+ if ($defineProperty)
+ try {
+ $defineProperty({}, "a", { value: 1 });
+ } catch {
+ $defineProperty = null;
+ }
+ module2.exports = function (originalFunction) {
+ var func = $reflectApply(bind, $call, arguments);
+ if ($gOPD && $defineProperty) {
+ var desc = $gOPD(func, "length");
+ desc.configurable &&
+ $defineProperty(func, "length", {
+ value:
+ 1 + $max(0, originalFunction.length - (arguments.length - 1)),
+ });
+ }
+ return func;
+ };
+ var applyBind = function () {
+ return $reflectApply(bind, $apply, arguments);
+ };
+ $defineProperty
+ ? $defineProperty(module2.exports, "apply", { value: applyBind })
+ : (module2.exports.apply = applyBind);
+ },
+});
+
+// object-is/implementation.js
+var require_implementation3 = __commonJS({
+ "object-is/implementation.js"(exports, module2) {
+ "use strict";
+ var numberIsNaN = function (value) {
+ return value !== value;
+ };
+ module2.exports = function (a, b) {
+ return a === 0 && b === 0
+ ? 1 / a == 1 / b
+ : !!(a === b || (numberIsNaN(a) && numberIsNaN(b)));
+ };
+ },
+});
+
+// object-is/polyfill.js
+var require_polyfill = __commonJS({
+ "object-is/polyfill.js"(exports, module2) {
+ "use strict";
+ var implementation = require_implementation3();
+ module2.exports = function () {
+ return typeof Object.is == "function" ? Object.is : implementation;
+ };
+ },
+});
+
+// object-is/shim.js
+var require_shim = __commonJS({
+ "object-is/shim.js"(exports, module2) {
+ "use strict";
+ var getPolyfill = require_polyfill(),
+ define = require_define_properties();
+ module2.exports = function () {
+ var polyfill = getPolyfill();
+ return (
+ define(
+ Object,
+ { is: polyfill },
+ {
+ is: function () {
+ return Object.is !== polyfill;
+ },
+ }
+ ),
+ polyfill
+ );
+ };
+ },
+});
+
+// object-is/index.js
+var require_object_is = __commonJS({
+ "object-is/index.js"(exports, module2) {
+ "use strict";
+ var define = require_define_properties(),
+ callBind = require_call_bind(),
+ implementation = require_implementation3(),
+ getPolyfill = require_polyfill(),
+ shim = require_shim(),
+ polyfill = callBind(getPolyfill(), Object);
+ define(polyfill, {
+ getPolyfill,
+ implementation,
+ shim,
+ });
+ module2.exports = polyfill;
+ },
+});
+
+// is-nan/implementation.js
+var require_implementation4 = __commonJS({
+ "is-nan/implementation.js"(exports, module2) {
+ "use strict";
+ module2.exports = function (value) {
+ return value !== value;
+ };
+ },
+});
+
+// is-nan/polyfill.js
+var require_polyfill2 = __commonJS({
+ "is-nan/polyfill.js"(exports, module2) {
+ "use strict";
+ var implementation = require_implementation4();
+ module2.exports = function () {
+ return Number.isNaN && Number.isNaN(NaN) && !Number.isNaN("a")
+ ? Number.isNaN
+ : implementation;
+ };
+ },
+});
+
+// is-nan/shim.js
+var require_shim2 = __commonJS({
+ "is-nan/shim.js"(exports, module2) {
+ "use strict";
+ var define = require_define_properties(),
+ getPolyfill = require_polyfill2();
+ module2.exports = function () {
+ var polyfill = getPolyfill();
+ return (
+ define(
+ Number,
+ { isNaN: polyfill },
+ {
+ isNaN: function () {
+ return Number.isNaN !== polyfill;
+ },
+ }
+ ),
+ polyfill
+ );
+ };
+ },
+});
+
+// is-nan/index.js
+var require_is_nan = __commonJS({
+ "is-nan/index.js"(exports, module2) {
+ "use strict";
+ var callBind = require_call_bind(),
+ define = require_define_properties(),
+ implementation = require_implementation4(),
+ getPolyfill = require_polyfill2(),
+ shim = require_shim2(),
+ polyfill = callBind(getPolyfill(), Number);
+ define(polyfill, {
+ getPolyfill,
+ implementation,
+ shim,
+ });
+ module2.exports = polyfill;
+ },
+});
+
+// assert/build/internal/util/comparisons.js
+var require_comparisons = __commonJS({
+ "assert/build/internal/util/comparisons.js"(exports, module2) {
+ "use strict";
+ function _slicedToArray(arr, i) {
+ return (
+ _arrayWithHoles(arr) ||
+ _iterableToArrayLimit(arr, i) ||
+ _nonIterableRest()
+ );
+ }
+ function _nonIterableRest() {
+ throw new TypeError(
+ "Invalid attempt to destructure non-iterable instance"
+ );
+ }
+ function _iterableToArrayLimit(arr, i) {
+ var _arr = [],
+ _n = !0,
+ _d = !1,
+ _e = void 0;
+ try {
+ for (
+ var _i = arr[Symbol.iterator](), _s;
+ !(_n = (_s = _i.next()).done) &&
+ (_arr.push(_s.value), !(i && _arr.length === i));
+ _n = !0
+ );
+ } catch (err) {
+ (_d = !0), (_e = err);
+ } finally {
+ try {
+ !_n && _i.return != null && _i.return();
+ } finally {
+ if (_d) throw _e;
+ }
+ }
+ return _arr;
+ }
+ function _arrayWithHoles(arr) {
+ if (Array.isArray(arr)) return arr;
+ }
+ function _typeof(obj) {
+ return (
+ typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
+ ? (_typeof = function (obj2) {
+ return typeof obj2;
+ })
+ : (_typeof = function (obj2) {
+ return obj2 &&
+ typeof Symbol == "function" &&
+ obj2.constructor === Symbol &&
+ obj2 !== Symbol.prototype
+ ? "symbol"
+ : typeof obj2;
+ }),
+ _typeof(obj)
+ );
+ }
+ var regexFlagsSupported = /a/g.flags !== void 0,
+ arrayFromSet = function (set) {
+ var array = [];
+ return (
+ set.forEach(function (value) {
+ return array.push(value);
+ }),
+ array
+ );
+ },
+ arrayFromMap = function (map) {
+ var array = [];
+ return (
+ map.forEach(function (value, key) {
+ return array.push([key, value]);
+ }),
+ array
+ );
+ },
+ objectIs = Object.is ? Object.is : require_object_is(),
+ objectGetOwnPropertySymbols = Object.getOwnPropertySymbols
+ ? Object.getOwnPropertySymbols
+ : function () {
+ return [];
+ },
+ numberIsNaN = Number.isNaN ? Number.isNaN : require_is_nan();
+ function uncurryThis(f) {
+ return f.call.bind(f);
+ }
+ var hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty),
+ propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable),
+ objectToString = uncurryThis(Object.prototype.toString),
+ _require$types = require("util").types,
+ isAnyArrayBuffer = _require$types.isAnyArrayBuffer,
+ isArrayBufferView = _require$types.isArrayBufferView,
+ isDate = _require$types.isDate,
+ isMap = _require$types.isMap,
+ isRegExp = _require$types.isRegExp,
+ isSet = _require$types.isSet,
+ isNativeError = _require$types.isNativeError,
+ isBoxedPrimitive = _require$types.isBoxedPrimitive,
+ isNumberObject = _require$types.isNumberObject,
+ isStringObject = _require$types.isStringObject,
+ isBooleanObject = _require$types.isBooleanObject,
+ isBigIntObject = _require$types.isBigIntObject,
+ isSymbolObject = _require$types.isSymbolObject,
+ isFloat32Array = _require$types.isFloat32Array,
+ isFloat64Array = _require$types.isFloat64Array;
+ function isNonIndex(key) {
+ if (key.length === 0 || key.length > 10) return !0;
+ for (var i = 0; i < key.length; i++) {
+ var code = key.charCodeAt(i);
+ if (code < 48 || code > 57) return !0;
+ }
+ return key.length === 10 && key >= Math.pow(2, 32);
+ }
+ function getOwnNonIndexProperties(value) {
+ return Object.keys(value)
+ .filter(isNonIndex)
+ .concat(
+ objectGetOwnPropertySymbols(value).filter(
+ Object.prototype.propertyIsEnumerable.bind(value)
+ )
+ );
+ }
+ function compare(a, b) {
+ if (a === b) return 0;
+ for (
+ var x = a.length, y = b.length, i = 0, len = Math.min(x, y);
+ i < len;
+ ++i
+ )
+ if (a[i] !== b[i]) {
+ (x = a[i]), (y = b[i]);
+ break;
+ }
+ return x < y ? -1 : y < x ? 1 : 0;
+ }
+ var ONLY_ENUMERABLE = void 0,
+ kStrict = !0,
+ kLoose = !1,
+ kNoIterator = 0,
+ kIsArray = 1,
+ kIsSet = 2,
+ kIsMap = 3;
+ function areSimilarRegExps(a, b) {
+ return regexFlagsSupported
+ ? a.source === b.source && a.flags === b.flags
+ : RegExp.prototype.toString.call(a) ===
+ RegExp.prototype.toString.call(b);
+ }
+ function areSimilarFloatArrays(a, b) {
+ if (a.byteLength !== b.byteLength) return !1;
+ for (var offset = 0; offset < a.byteLength; offset++)
+ if (a[offset] !== b[offset]) return !1;
+ return !0;
+ }
+ function areSimilarTypedArrays(a, b) {
+ return a.byteLength !== b.byteLength
+ ? !1
+ : compare(
+ new Uint8Array(a.buffer, a.byteOffset, a.byteLength),
+ new Uint8Array(b.buffer, b.byteOffset, b.byteLength)
+ ) === 0;
+ }
+ function areEqualArrayBuffers(buf1, buf2) {
+ return (
+ buf1.byteLength === buf2.byteLength &&
+ compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0
+ );
+ }
+ function isEqualBoxedPrimitive(val1, val2) {
+ return isNumberObject(val1)
+ ? isNumberObject(val2) &&
+ objectIs(
+ Number.prototype.valueOf.call(val1),
+ Number.prototype.valueOf.call(val2)
+ )
+ : isStringObject(val1)
+ ? isStringObject(val2) &&
+ String.prototype.valueOf.call(val1) ===
+ String.prototype.valueOf.call(val2)
+ : isBooleanObject(val1)
+ ? isBooleanObject(val2) &&
+ Boolean.prototype.valueOf.call(val1) ===
+ Boolean.prototype.valueOf.call(val2)
+ : isBigIntObject(val1)
+ ? isBigIntObject(val2) &&
+ BigInt.prototype.valueOf.call(val1) ===
+ BigInt.prototype.valueOf.call(val2)
+ : isSymbolObject(val2) &&
+ Symbol.prototype.valueOf.call(val1) ===
+ Symbol.prototype.valueOf.call(val2);
+ }
+ function innerDeepEqual(val1, val2, strict, memos) {
+ if (val1 === val2)
+ return val1 !== 0 ? !0 : strict ? objectIs(val1, val2) : !0;
+ if (strict) {
+ if (_typeof(val1) !== "object")
+ return (
+ typeof val1 == "number" && numberIsNaN(val1) && numberIsNaN(val2)
+ );
+ if (
+ _typeof(val2) !== "object" ||
+ val1 === null ||
+ val2 === null ||
+ Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)
+ )
+ return !1;
+ } else {
+ if (val1 === null || _typeof(val1) !== "object")
+ return val2 === null || _typeof(val2) !== "object"
+ ? val1 == val2
+ : !1;
+ if (val2 === null || _typeof(val2) !== "object") return !1;
+ }
+ var val1Tag = objectToString(val1),
+ val2Tag = objectToString(val2);
+ if (val1Tag !== val2Tag) return !1;
+ if (Array.isArray(val1)) {
+ if (val1.length !== val2.length) return !1;
+ var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE),
+ keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
+ return keys1.length !== keys2.length
+ ? !1
+ : keyCheck(val1, val2, strict, memos, kIsArray, keys1);
+ }
+ if (
+ val1Tag === "[object Object]" &&
+ ((!isMap(val1) && isMap(val2)) || (!isSet(val1) && isSet(val2)))
+ )
+ return !1;
+ if (isDate(val1)) {
+ if (
+ !isDate(val2) ||
+ Date.prototype.getTime.call(val1) !==
+ Date.prototype.getTime.call(val2)
+ )
+ return !1;
+ } else if (isRegExp(val1)) {
+ if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) return !1;
+ } else if (isNativeError(val1) || val1 instanceof Error) {
+ if (val1.message !== val2.message || val1.name !== val2.name) return !1;
+ } else if (isArrayBufferView(val1)) {
+ if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {
+ if (!areSimilarFloatArrays(val1, val2)) return !1;
+ } else if (!areSimilarTypedArrays(val1, val2)) return !1;
+ var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE),
+ _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
+ return _keys.length !== _keys2.length
+ ? !1
+ : keyCheck(val1, val2, strict, memos, kNoIterator, _keys);
+ } else {
+ if (isSet(val1))
+ return !isSet(val2) || val1.size !== val2.size
+ ? !1
+ : keyCheck(val1, val2, strict, memos, kIsSet);
+ if (isMap(val1))
+ return !isMap(val2) || val1.size !== val2.size
+ ? !1
+ : keyCheck(val1, val2, strict, memos, kIsMap);
+ if (isAnyArrayBuffer(val1)) {
+ if (!areEqualArrayBuffers(val1, val2)) return !1;
+ } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2))
+ return !1;
+ }
+ return keyCheck(val1, val2, strict, memos, kNoIterator);
+ }
+ function getEnumerables(val, keys) {
+ return keys.filter(function (k) {
+ return propertyIsEnumerable(val, k);
+ });
+ }
+ function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
+ if (arguments.length === 5) {
+ aKeys = Object.keys(val1);
+ var bKeys = Object.keys(val2);
+ if (aKeys.length !== bKeys.length) return !1;
+ }
+ for (var i = 0; i < aKeys.length; i++)
+ if (!hasOwnProperty(val2, aKeys[i])) return !1;
+ if (strict && arguments.length === 5) {
+ var symbolKeysA = objectGetOwnPropertySymbols(val1);
+ if (symbolKeysA.length !== 0) {
+ var count = 0;
+ for (i = 0; i < symbolKeysA.length; i++) {
+ var key = symbolKeysA[i];
+ if (propertyIsEnumerable(val1, key)) {
+ if (!propertyIsEnumerable(val2, key)) return !1;
+ aKeys.push(key), count++;
+ } else if (propertyIsEnumerable(val2, key)) return !1;
+ }
+ var symbolKeysB = objectGetOwnPropertySymbols(val2);
+ if (
+ symbolKeysA.length !== symbolKeysB.length &&
+ getEnumerables(val2, symbolKeysB).length !== count
+ )
+ return !1;
+ } else {
+ var _symbolKeysB = objectGetOwnPropertySymbols(val2);
+ if (
+ _symbolKeysB.length !== 0 &&
+ getEnumerables(val2, _symbolKeysB).length !== 0
+ )
+ return !1;
+ }
+ }
+ if (
+ aKeys.length === 0 &&
+ (iterationType === kNoIterator ||
+ (iterationType === kIsArray && val1.length === 0) ||
+ val1.size === 0)
+ )
+ return !0;
+ if (memos === void 0)
+ memos = {
+ val1: new Map(),
+ val2: new Map(),
+ position: 0,
+ };
+ else {
+ var val2MemoA = memos.val1.get(val1);
+ if (val2MemoA !== void 0) {
+ var val2MemoB = memos.val2.get(val2);
+ if (val2MemoB !== void 0) return val2MemoA === val2MemoB;
+ }
+ memos.position++;
+ }
+ memos.val1.set(val1, memos.position),
+ memos.val2.set(val2, memos.position);
+ var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);
+ return memos.val1.delete(val1), memos.val2.delete(val2), areEq;
+ }
+ function setHasEqualElement(set, val1, strict, memo) {
+ for (
+ var setValues = arrayFromSet(set), i = 0;
+ i < setValues.length;
+ i++
+ ) {
+ var val2 = setValues[i];
+ if (innerDeepEqual(val1, val2, strict, memo))
+ return set.delete(val2), !0;
+ }
+ return !1;
+ }
+ function findLooseMatchingPrimitives(prim) {
+ switch (_typeof(prim)) {
+ case "undefined":
+ return null;
+ case "object":
+ return;
+ case "symbol":
+ return !1;
+ case "string":
+ prim = +prim;
+ case "number":
+ if (numberIsNaN(prim)) return !1;
+ }
+ return !0;
+ }
+ function setMightHaveLoosePrim(a, b, prim) {
+ var altValue = findLooseMatchingPrimitives(prim);
+ return altValue ?? (b.has(altValue) && !a.has(altValue));
+ }
+ function mapMightHaveLoosePrim(a, b, prim, item, memo) {
+ var altValue = findLooseMatchingPrimitives(prim);
+ if (altValue != null) return altValue;
+ var curB = b.get(altValue);
+ return (curB === void 0 && !b.has(altValue)) ||
+ !innerDeepEqual(item, curB, !1, memo)
+ ? !1
+ : !a.has(altValue) && innerDeepEqual(item, curB, !1, memo);
+ }
+ function setEquiv(a, b, strict, memo) {
+ for (
+ var set = null, aValues = arrayFromSet(a), i = 0;
+ i < aValues.length;
+ i++
+ ) {
+ var val = aValues[i];
+ if (_typeof(val) === "object" && val !== null)
+ set === null && (set = new Set()), set.add(val);
+ else if (!b.has(val)) {
+ if (strict || !setMightHaveLoosePrim(a, b, val)) return !1;
+ set === null && (set = new Set()), set.add(val);
+ }
+ }
+ if (set !== null) {
+ for (var bValues = arrayFromSet(b), _i = 0; _i < bValues.length; _i++) {
+ var _val = bValues[_i];
+ if (_typeof(_val) === "object" && _val !== null) {
+ if (!setHasEqualElement(set, _val, strict, memo)) return !1;
+ } else if (
+ !strict &&
+ !a.has(_val) &&
+ !setHasEqualElement(set, _val, strict, memo)
+ )
+ return !1;
+ }
+ return set.size === 0;
+ }
+ return !0;
+ }
+ function mapHasEqualEntry(set, map, key1, item1, strict, memo) {
+ for (
+ var setValues = arrayFromSet(set), i = 0;
+ i < setValues.length;
+ i++
+ ) {
+ var key2 = setValues[i];
+ if (
+ innerDeepEqual(key1, key2, strict, memo) &&
+ innerDeepEqual(item1, map.get(key2), strict, memo)
+ )
+ return set.delete(key2), !0;
+ }
+ return !1;
+ }
+ function mapEquiv(a, b, strict, memo) {
+ for (
+ var set = null, aEntries = arrayFromMap(a), i = 0;
+ i < aEntries.length;
+ i++
+ ) {
+ var _aEntries$i = _slicedToArray(aEntries[i], 2),
+ key = _aEntries$i[0],
+ item1 = _aEntries$i[1];
+ if (_typeof(key) === "object" && key !== null)
+ set === null && (set = new Set()), set.add(key);
+ else {
+ var item2 = b.get(key);
+ if (
+ (item2 === void 0 && !b.has(key)) ||
+ !innerDeepEqual(item1, item2, strict, memo)
+ ) {
+ if (strict || !mapMightHaveLoosePrim(a, b, key, item1, memo))
+ return !1;
+ set === null && (set = new Set()), set.add(key);
+ }
+ }
+ }
+ if (set !== null) {
+ for (
+ var bEntries = arrayFromMap(b), _i2 = 0;
+ _i2 < bEntries.length;
+ _i2++
+ ) {
+ var _bEntries$_i = _slicedToArray(bEntries[_i2], 2),
+ key = _bEntries$_i[0],
+ item = _bEntries$_i[1];
+ if (_typeof(key) === "object" && key !== null) {
+ if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return !1;
+ } else if (
+ !strict &&
+ (!a.has(key) || !innerDeepEqual(a.get(key), item, !1, memo)) &&
+ !mapHasEqualEntry(set, a, key, item, !1, memo)
+ )
+ return !1;
+ }
+ return set.size === 0;
+ }
+ return !0;
+ }
+ function objEquiv(a, b, strict, keys, memos, iterationType) {
+ var i = 0;
+ if (iterationType === kIsSet) {
+ if (!setEquiv(a, b, strict, memos)) return !1;
+ } else if (iterationType === kIsMap) {
+ if (!mapEquiv(a, b, strict, memos)) return !1;
+ } else if (iterationType === kIsArray)
+ for (; i < a.length; i++)
+ if (hasOwnProperty(a, i)) {
+ if (
+ !hasOwnProperty(b, i) ||
+ !innerDeepEqual(a[i], b[i], strict, memos)
+ )
+ return !1;
+ } else {
+ if (hasOwnProperty(b, i)) return !1;
+ for (var keysA = Object.keys(a); i < keysA.length; i++) {
+ var key = keysA[i];
+ if (
+ !hasOwnProperty(b, key) ||
+ !innerDeepEqual(a[key], b[key], strict, memos)
+ )
+ return !1;
+ }
+ return keysA.length === Object.keys(b).length;
+ }
+ for (i = 0; i < keys.length; i++) {
+ var _key = keys[i];
+ if (!innerDeepEqual(a[_key], b[_key], strict, memos)) return !1;
+ }
+ return !0;
+ }
+ function isDeepEqual(val1, val2) {
+ return innerDeepEqual(val1, val2, kLoose);
+ }
+ function isDeepStrictEqual(val1, val2) {
+ return innerDeepEqual(val1, val2, kStrict);
+ }
+ module2.exports = {
+ isDeepEqual,
+ isDeepStrictEqual,
+ };
+ },
+});
+
+// assert/build/assert.js
+var require_assert = __commonJS({
+ "assert/build/assert.js"(exports, module2) {
+ "use strict";
+ function _typeof(obj) {
+ return (
+ typeof Symbol == "function" && typeof Symbol.iterator == "symbol"
+ ? (_typeof = function (obj2) {
+ return typeof obj2;
+ })
+ : (_typeof = function (obj2) {
+ return obj2 &&
+ typeof Symbol == "function" &&
+ obj2.constructor === Symbol &&
+ obj2 !== Symbol.prototype
+ ? "symbol"
+ : typeof obj2;
+ }),
+ _typeof(obj)
+ );
+ }
+ function _classCallCheck(instance, Constructor) {
+ if (!(instance instanceof Constructor))
+ throw new TypeError("Cannot call a class as a function");
+ }
+ var _require = require_errors(),
+ _require$codes = _require.codes,
+ ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT,
+ ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE,
+ ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE,
+ ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE,
+ ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS,
+ AssertionError = require_assertion_error(),
+ _require2 = require("util"),
+ inspect = _require2.inspect,
+ _require$types = require("util").types,
+ isPromise = _require$types.isPromise,
+ isRegExp = _require$types.isRegExp,
+ objectAssign = Object.assign
+ ? Object.assign
+ : require_es6_object_assign().assign,
+ objectIs = Object.is ? Object.is : require_object_is(),
+ errorCache = new Map(),
+ isDeepEqual,
+ isDeepStrictEqual;
+ function lazyLoadComparison() {
+ var comparison = require_comparisons();
+ (isDeepEqual = comparison.isDeepEqual),
+ (isDeepStrictEqual = comparison.isDeepStrictEqual);
+ }
+ var warned = !1,
+ assert = (module2.exports = ok),
+ NO_EXCEPTION_SENTINEL = {};
+ function innerFail(obj) {
+ throw obj.message instanceof Error
+ ? obj.message
+ : new AssertionError(obj);
+ }
+ function fail(actual, expected, message, operator, stackStartFn) {
+ var argsLen = arguments.length,
+ internalMessage;
+ if (argsLen === 0) internalMessage = "Failed";
+ else if (argsLen === 1) (message = actual), (actual = void 0);
+ else {
+ if (warned === !1) {
+ warned = !0;
+ var warn = process.emitWarning
+ ? process.emitWarning
+ : console.warn.bind(console);
+ warn(
+ "assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.",
+ "DeprecationWarning",
+ "DEP0094"
+ );
+ }
+ argsLen === 2 && (operator = "!=");
+ }
+ if (message instanceof Error) throw message;
+ var errArgs = {
+ actual,
+ expected,
+ operator: operator === void 0 ? "fail" : operator,
+ stackStartFn: stackStartFn || fail,
+ };
+ message !== void 0 && (errArgs.message = message);
+ var err = new AssertionError(errArgs);
+ throw (
+ (internalMessage &&
+ ((err.message = internalMessage), (err.generatedMessage = !0)),
+ err)
+ );
+ }
+ assert.fail = fail;
+ assert.AssertionError = AssertionError;
+ function innerOk(fn, argLen, value, message) {
+ if (!value) {
+ var generatedMessage = !1;
+ if (argLen === 0)
+ (generatedMessage = !0),
+ (message = "No value argument passed to `assert.ok()`");
+ else if (message instanceof Error) throw message;
+ var err = new AssertionError({
+ actual: value,
+ expected: !0,
+ message,
+ operator: "==",
+ stackStartFn: fn,
+ });
+ throw ((err.generatedMessage = generatedMessage), err);
+ }
+ }
+ function ok() {
+ for (
+ var _len = arguments.length, args = new Array(_len), _key = 0;
+ _key < _len;
+ _key++
+ )
+ args[_key] = arguments[_key];
+ innerOk.apply(void 0, [ok, args.length].concat(args));
+ }
+ assert.ok = ok;
+ assert.equal = function equal(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ actual != expected &&
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "==",
+ stackStartFn: equal,
+ });
+ };
+ assert.notEqual = function notEqual(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ actual == expected &&
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "!=",
+ stackStartFn: notEqual,
+ });
+ };
+ assert.deepEqual = function deepEqual(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ isDeepEqual === void 0 && lazyLoadComparison(),
+ isDeepEqual(actual, expected) ||
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "deepEqual",
+ stackStartFn: deepEqual,
+ });
+ };
+ assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ isDeepEqual === void 0 && lazyLoadComparison(),
+ isDeepEqual(actual, expected) &&
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "notDeepEqual",
+ stackStartFn: notDeepEqual,
+ });
+ };
+ assert.deepStrictEqual = function deepStrictEqual(
+ actual,
+ expected,
+ message
+ ) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ isDeepEqual === void 0 && lazyLoadComparison(),
+ isDeepStrictEqual(actual, expected) ||
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "deepStrictEqual",
+ stackStartFn: deepStrictEqual,
+ });
+ };
+ assert.notDeepStrictEqual = notDeepStrictEqual;
+ function notDeepStrictEqual(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ isDeepEqual === void 0 && lazyLoadComparison(),
+ isDeepStrictEqual(actual, expected) &&
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "notDeepStrictEqual",
+ stackStartFn: notDeepStrictEqual,
+ });
+ }
+ assert.strictEqual = function strictEqual(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ objectIs(actual, expected) ||
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "strictEqual",
+ stackStartFn: strictEqual,
+ });
+ };
+ assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
+ if (arguments.length < 2)
+ throw new ERR_MISSING_ARGS("actual", "expected");
+ objectIs(actual, expected) &&
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: "notStrictEqual",
+ stackStartFn: notStrictEqual,
+ });
+ };
+ var Comparison = function Comparison2(obj, keys, actual) {
+ var _this = this;
+ _classCallCheck(this, Comparison2),
+ keys.forEach(function (key) {
+ key in obj &&
+ (actual !== void 0 &&
+ typeof actual[key] == "string" &&
+ isRegExp(obj[key]) &&
+ obj[key].test(actual[key])
+ ? (_this[key] = actual[key])
+ : (_this[key] = obj[key]));
+ });
+ };
+ function compareExceptionKey(actual, expected, key, message, keys, fn) {
+ if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {
+ if (!message) {
+ var a = new Comparison(actual, keys),
+ b = new Comparison(expected, keys, actual),
+ err = new AssertionError({
+ actual: a,
+ expected: b,
+ operator: "deepStrictEqual",
+ stackStartFn: fn,
+ });
+ throw (
+ ((err.actual = actual),
+ (err.expected = expected),
+ (err.operator = fn.name),
+ err)
+ );
+ }
+ innerFail({
+ actual,
+ expected,
+ message,
+ operator: fn.name,
+ stackStartFn: fn,
+ });
+ }
+ }
+ function expectedException(actual, expected, msg, fn) {
+ if (typeof expected != "function") {
+ if (isRegExp(expected)) return expected.test(actual);
+ if (arguments.length === 2)
+ throw new ERR_INVALID_ARG_TYPE(
+ "expected",
+ ["Function", "RegExp"],
+ expected
+ );
+ if (_typeof(actual) !== "object" || actual === null) {
+ var err = new AssertionError({
+ actual,
+ expected,
+ message: msg,
+ operator: "deepStrictEqual",
+ stackStartFn: fn,
+ });
+ throw ((err.operator = fn.name), err);
+ }
+ var keys = Object.keys(expected);
+ if (expected instanceof Error) keys.push("name", "message");
+ else if (keys.length === 0)
+ throw new ERR_INVALID_ARG_VALUE(
+ "error",
+ expected,
+ "may not be an empty object"
+ );
+ return (
+ isDeepEqual === void 0 && lazyLoadComparison(),
+ keys.forEach(function (key) {
+ (typeof actual[key] == "string" &&
+ isRegExp(expected[key]) &&
+ expected[key].test(actual[key])) ||
+ compareExceptionKey(actual, expected, key, msg, keys, fn);
+ }),
+ !0
+ );
+ }
+ return expected.prototype !== void 0 && actual instanceof expected
+ ? !0
+ : Error.isPrototypeOf(expected)
+ ? !1
+ : expected.call({}, actual) === !0;
+ }
+ function getActual(fn) {
+ if (typeof fn != "function")
+ throw new ERR_INVALID_ARG_TYPE("fn", "Function", fn);
+ try {
+ fn();
+ } catch (e) {
+ return e;
+ }
+ return NO_EXCEPTION_SENTINEL;
+ }
+ function checkIsPromise(obj) {
+ return (
+ isPromise(obj) ||
+ (obj !== null &&
+ _typeof(obj) === "object" &&
+ typeof obj.then == "function" &&
+ typeof obj.catch == "function")
+ );
+ }
+ function waitForActual(promiseFn) {
+ return Promise.resolve().then(function () {
+ var resultPromise;
+ if (typeof promiseFn == "function") {
+ if (((resultPromise = promiseFn()), !checkIsPromise(resultPromise)))
+ throw new ERR_INVALID_RETURN_VALUE(
+ "instance of Promise",
+ "promiseFn",
+ resultPromise
+ );
+ } else if (checkIsPromise(promiseFn)) resultPromise = promiseFn;
+ else
+ throw new ERR_INVALID_ARG_TYPE(
+ "promiseFn",
+ ["Function", "Promise"],
+ promiseFn
+ );
+ return Promise.resolve()
+ .then(function () {
+ return resultPromise;
+ })
+ .then(function () {
+ return NO_EXCEPTION_SENTINEL;
+ })
+ .catch(function (e) {
+ return e;
+ });
+ });
+ }
+ function expectsError(stackStartFn, actual, error, message) {
+ if (typeof error == "string") {
+ if (arguments.length === 4)
+ throw new ERR_INVALID_ARG_TYPE(
+ "error",
+ ["Object", "Error", "Function", "RegExp"],
+ error
+ );
+ if (_typeof(actual) === "object" && actual !== null) {
+ if (actual.message === error)
+ throw new ERR_AMBIGUOUS_ARGUMENT(
+ "error/message",
+ 'The error message "'.concat(
+ actual.message,
+ '" is identical to the message.'
+ )
+ );
+ } else if (actual === error)
+ throw new ERR_AMBIGUOUS_ARGUMENT(
+ "error/message",
+ 'The error "'.concat(actual, '" is identical to the message.')
+ );
+ (message = error), (error = void 0);
+ } else if (
+ error != null &&
+ _typeof(error) !== "object" &&
+ typeof error != "function"
+ )
+ throw new ERR_INVALID_ARG_TYPE(
+ "error",
+ ["Object", "Error", "Function", "RegExp"],
+ error
+ );
+ if (actual === NO_EXCEPTION_SENTINEL) {
+ var details = "";
+ error && error.name && (details += " (".concat(error.name, ")")),
+ (details += message ? ": ".concat(message) : ".");
+ var fnType =
+ stackStartFn.name === "rejects" ? "rejection" : "exception";
+ innerFail({
+ actual: void 0,
+ expected: error,
+ operator: stackStartFn.name,
+ message: "Missing expected ".concat(fnType).concat(details),
+ stackStartFn,
+ });
+ }
+ if (error && !expectedException(actual, error, message, stackStartFn))
+ throw actual;
+ }
+ function expectsNoError(stackStartFn, actual, error, message) {
+ if (actual !== NO_EXCEPTION_SENTINEL) {
+ if (
+ (typeof error == "string" && ((message = error), (error = void 0)),
+ !error || expectedException(actual, error))
+ ) {
+ var details = message ? ": ".concat(message) : ".",
+ fnType =
+ stackStartFn.name === "doesNotReject" ? "rejection" : "exception";
+ innerFail({
+ actual,
+ expected: error,
+ operator: stackStartFn.name,
+ message:
+ "Got unwanted ".concat(fnType).concat(
+ details,
+ `
+`
+ ) + 'Actual message: "'.concat(actual && actual.message, '"'),
+ stackStartFn,
+ });
+ }
+ throw actual;
+ }
+ }
+ assert.throws = function throws(promiseFn) {
+ for (
+ var _len2 = arguments.length,
+ args = new Array(_len2 > 1 ? _len2 - 1 : 0),
+ _key2 = 1;
+ _key2 < _len2;
+ _key2++
+ )
+ args[_key2 - 1] = arguments[_key2];
+ expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));
+ };
+ assert.rejects = function rejects(promiseFn) {
+ for (
+ var _len3 = arguments.length,
+ args = new Array(_len3 > 1 ? _len3 - 1 : 0),
+ _key3 = 1;
+ _key3 < _len3;
+ _key3++
+ )
+ args[_key3 - 1] = arguments[_key3];
+ return waitForActual(promiseFn).then(function (result) {
+ return expectsError.apply(void 0, [rejects, result].concat(args));
+ });
+ };
+ assert.doesNotThrow = function doesNotThrow(fn) {
+ for (
+ var _len4 = arguments.length,
+ args = new Array(_len4 > 1 ? _len4 - 1 : 0),
+ _key4 = 1;
+ _key4 < _len4;
+ _key4++
+ )
+ args[_key4 - 1] = arguments[_key4];
+ expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));
+ };
+ assert.doesNotReject = function doesNotReject(fn) {
+ for (
+ var _len5 = arguments.length,
+ args = new Array(_len5 > 1 ? _len5 - 1 : 0),
+ _key5 = 1;
+ _key5 < _len5;
+ _key5++
+ )
+ args[_key5 - 1] = arguments[_key5];
+ return waitForActual(fn).then(function (result) {
+ return expectsNoError.apply(
+ void 0,
+ [doesNotReject, result].concat(args)
+ );
+ });
+ };
+ assert.ifError = function ifError(err) {
+ if (err != null) {
+ var message = "ifError got unwanted exception: ";
+ _typeof(err) === "object" && typeof err.message == "string"
+ ? err.message.length === 0 && err.constructor
+ ? (message += err.constructor.name)
+ : (message += err.message)
+ : (message += inspect(err));
+ var newErr = new AssertionError({
+ actual: err,
+ expected: null,
+ operator: "ifError",
+ message,
+ stackStartFn: ifError,
+ }),
+ origStack = err.stack;
+ if (typeof origStack == "string") {
+ var tmp2 = origStack.split(`
+`);
+ tmp2.shift();
+ for (
+ var tmp1 = newErr.stack.split(`
+`),
+ i = 0;
+ i < tmp2.length;
+ i++
+ ) {
+ var pos = tmp1.indexOf(tmp2[i]);
+ if (pos !== -1) {
+ tmp1 = tmp1.slice(0, pos);
+ break;
+ }
+ }
+ newErr.stack = ""
+ .concat(
+ tmp1.join(`
+`),
+ `
+`
+ )
+ .concat(
+ tmp2.join(`
+`)
+ );
+ }
+ throw newErr;
+ }
+ };
+ function strict() {
+ for (
+ var _len6 = arguments.length, args = new Array(_len6), _key6 = 0;
+ _key6 < _len6;
+ _key6++
+ )
+ args[_key6] = arguments[_key6];
+ innerOk.apply(void 0, [strict, args.length].concat(args));
+ }
+ assert.strict = objectAssign(strict, assert, {
+ equal: assert.strictEqual,
+ deepEqual: assert.deepStrictEqual,
+ notEqual: assert.notStrictEqual,
+ notDeepEqual: assert.notDeepStrictEqual,
+ });
+ assert.strict.strict = assert.strict;
+ },
+});
+const assert_module = require_assert();
+
+var wrapper =
+ (0,
+ function () {
+ const assert_module = require_assert();
+
+ /*!
+ * The buffer module from node.js, for the browser.
+ *
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
+ * @license MIT
+ */
+
+ return assert_module;
+ });
+wrapper[Symbol.for("CommonJS")] = true;
+export default wrapper;
+export var AssertionError = assert_module.AssertionError;
+export var assert = assert_module.assert;
+export var deepEqual = assert_module.deepEqual;
+export var deepStrictEqual = assert_module.deepStrictEqual;
+export var doesNotReject = assert_module.doesNotReject;
+export var doesNotThrow = assert_module.doesNotThrow;
+export var equal = assert_module.equal;
+export var fail = assert_module.fail;
+export var ifError = assert_module.ifError;
+export var notDeepEqual = assert_module.notDeepEqual;
+export var notDeepStrictEqual = assert_module.notDeepStrictEqual;
+export var notEqual = assert_module.notEqual;
+export var notStrictEqual = assert_module.notStrictEqual;
+export var ok = assert_module.ok;
+export var rejects = assert_module.rejects;
+export var strict = assert_module.strict;
+export var strictEqual = assert_module.strictEqual;
+export var throws = assert_module.throws;
+
+Object.defineProperties(wrapper, {
+ AssertionError: {
+ get() {
+ return AssertionError;
+ },
+ set(value) {
+ AssertionError = value;
+ return true;
+ },
+ configurable: true,
+ },
+ assert: {
+ get() {
+ return assert;
+ },
+ set(value) {
+ assert = value;
+ return true;
+ },
+ configurable: true,
+ },
+ deepEqual: {
+ get() {
+ return deepEqual;
+ },
+ set(value) {
+ deepEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ deepStrictEqual: {
+ get() {
+ return deepStrictEqual;
+ },
+ set(value) {
+ deepStrictEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ doesNotReject: {
+ get() {
+ return doesNotReject;
+ },
+ set(value) {
+ doesNotReject = value;
+ return true;
+ },
+ configurable: true,
+ },
+ doesNotThrow: {
+ get() {
+ return doesNotThrow;
+ },
+ set(value) {
+ doesNotThrow = value;
+ return true;
+ },
+ configurable: true,
+ },
+ equal: {
+ get() {
+ return equal;
+ },
+ set(value) {
+ equal = value;
+ return true;
+ },
+ configurable: true,
+ },
+ fail: {
+ get() {
+ return fail;
+ },
+ set(value) {
+ fail = value;
+ return true;
+ },
+ configurable: true,
+ },
+ ifError: {
+ get() {
+ return ifError;
+ },
+ set(value) {
+ ifError = value;
+ return true;
+ },
+ configurable: true,
+ },
+ notDeepEqual: {
+ get() {
+ return notDeepEqual;
+ },
+ set(value) {
+ notDeepEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ notDeepStrictEqual: {
+ get() {
+ return notDeepStrictEqual;
+ },
+ set(value) {
+ notDeepStrictEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ notEqual: {
+ get() {
+ return notEqual;
+ },
+ set(value) {
+ notEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ notStrictEqual: {
+ get() {
+ return notStrictEqual;
+ },
+ set(value) {
+ notStrictEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ ok: {
+ get() {
+ return ok;
+ },
+ set(value) {
+ ok = value;
+ return true;
+ },
+ configurable: true,
+ },
+ rejects: {
+ get() {
+ return rejects;
+ },
+ set(value) {
+ rejects = value;
+ return true;
+ },
+ configurable: true,
+ },
+ strict: {
+ get() {
+ return strict;
+ },
+ set(value) {
+ strict = value;
+ return true;
+ },
+ configurable: true,
+ },
+ strictEqual: {
+ get() {
+ return strictEqual;
+ },
+ set(value) {
+ strictEqual = value;
+ return true;
+ },
+ configurable: true,
+ },
+ throws: {
+ get() {
+ return throws;
+ },
+ set(value) {
+ throws = value;
+ return true;
+ },
+ configurable: true,
+ },
+});
diff --git a/src/bun.js/javascript.zig b/src/bun.js/javascript.zig
index 4c120d179..a7b0b6ec3 100644
--- a/src/bun.js/javascript.zig
+++ b/src/bun.js/javascript.zig
@@ -883,6 +883,17 @@ pub const VirtualMachine = struct {
.hash = 0,
};
},
+ .@"node:assert" => {
+ return ResolvedSource{
+ .allocator = null,
+ .source_code = ZigString.init(
+ @as(string, jsModuleFromFile("assert.exports.js")),
+ ),
+ .specifier = ZigString.init("node:assert"),
+ .source_url = ZigString.init("node:assert"),
+ .hash = 0,
+ };
+ },
.@"bun:sqlite" => {
return ResolvedSource{
.allocator = null,
@@ -1204,6 +1215,11 @@ pub const VirtualMachine = struct {
}
}
+ if (HardcodedModule.Aliases.getWithEql(specifier, ZigString.eqlComptime)) |hardcoded| {
+ res.* = ErrorableZigString.ok(ZigString.init(hardcoded));
+ return;
+ }
+
_resolve(&result, global, specifier.slice(), source.slice(), is_a_file_path, realpath) catch |err| {
// This should almost always just apply to dynamic imports
@@ -2574,6 +2590,7 @@ pub const HardcodedModule = enum {
@"bun:sqlite",
@"depd",
@"detect-libc",
+ @"node:assert",
@"node:buffer",
@"node:events",
@"node:fs",
@@ -2581,19 +2598,23 @@ pub const HardcodedModule = enum {
@"node:http",
@"node:module",
@"node:os",
- @"node:stream",
- @"node:string_decoder",
@"node:path",
@"node:perf_hooks",
@"node:process",
+ @"node:stream",
@"node:stream/consumer",
@"node:stream/web",
+ @"node:string_decoder",
@"node:timers",
@"node:timers/promises",
@"node:url",
@"undici",
@"ws",
+ /// Already resolved modules go in here.
+ /// This does not remap the module name, it is just a hash table.
+ /// Do not put modules that have aliases in here
+ /// Put those in Aliases
pub const Map = bun.ComptimeStringMap(
HardcodedModule,
.{
@@ -2604,11 +2625,7 @@ pub const HardcodedModule = enum {
.{ "bun:sqlite", HardcodedModule.@"bun:sqlite" },
.{ "depd", HardcodedModule.@"depd" },
.{ "detect-libc", HardcodedModule.@"detect-libc" },
- .{ "events", HardcodedModule.@"node:events" },
- .{ "ffi", HardcodedModule.@"bun:ffi" },
- .{ "fs", HardcodedModule.@"node:fs" },
- .{ "http", HardcodedModule.@"node:http" },
- .{ "module", HardcodedModule.@"node:module" },
+ .{ "node:assert", HardcodedModule.@"node:assert" },
.{ "node:buffer", HardcodedModule.@"node:buffer" },
.{ "node:events", HardcodedModule.@"node:events" },
.{ "node:fs", HardcodedModule.@"node:fs" },
@@ -2628,18 +2645,14 @@ pub const HardcodedModule = enum {
.{ "node:timers", HardcodedModule.@"node:timers" },
.{ "node:timers/promises", HardcodedModule.@"node:timers/promises" },
.{ "node:url", HardcodedModule.@"node:url" },
- .{ "os", HardcodedModule.@"node:os" },
- .{ "path", HardcodedModule.@"node:path" },
- .{ "process", HardcodedModule.@"node:process" },
- .{ "streams", HardcodedModule.@"node:stream" },
- .{ "string_decoder", HardcodedModule.@"node:string_decoder" },
.{ "undici", HardcodedModule.@"undici" },
.{ "ws", HardcodedModule.@"ws" },
},
);
- pub const LinkerMap = bun.ComptimeStringMap(
+ pub const Aliases = bun.ComptimeStringMap(
string,
.{
+ .{ "assert", "node:assert" },
.{ "buffer", "node:buffer" },
.{ "bun", "bun" },
.{ "bun:ffi", "bun:ffi" },
@@ -2655,6 +2668,7 @@ pub const HardcodedModule = enum {
.{ "fs/promises", "node:fs/promises" },
.{ "http", "node:http" },
.{ "module", "node:module" },
+ .{ "node:assert", "node:assert" },
.{ "node:buffer", "node:buffer" },
.{ "node:events", "node:events" },
.{ "node:fs", "node:fs" },
@@ -2763,6 +2777,17 @@ fn dumpSource(specifier: string, printer: anytype) !void {
}
pub const ModuleLoader = struct {
+ pub export fn Bun__getDefaultLoader(global: *JSC.JSGlobalObject, str: *ZigString) Api.Loader {
+ var jsc_vm = global.bunVM();
+ const filename = str.toSlice(jsc_vm.allocator);
+ defer filename.deinit();
+ const loader = jsc_vm.bundler.options.loader(Fs.PathName.init(filename.slice()).ext).toAPI();
+ if (loader == .file) {
+ return Api.Loader.js;
+ }
+
+ return loader;
+ }
pub fn transpileSourceCode(
jsc_vm: *VirtualMachine,
specifier: string,
@@ -3285,6 +3310,7 @@ pub const ModuleLoader = struct {
_ = Bun__runVirtualModule;
_ = Bun__transpileFile;
_ = Bun__fetchBuiltinModule;
+ _ = Bun__getDefaultLoader;
}
};