@dxos/node-std 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.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.
Files changed (68) hide show
  1. package/dist/lib/_/config.mjs +22 -0
  2. package/dist/lib/_/config.mjs.map +1 -0
  3. package/dist/lib/assert.mjs +1613 -0
  4. package/dist/lib/assert.mjs.map +1 -0
  5. package/dist/lib/buffer.mjs +6 -0
  6. package/dist/lib/buffer.mjs.map +1 -0
  7. package/dist/lib/chunk-buffer.mjs +1459 -0
  8. package/dist/lib/chunk-buffer.mjs.map +1 -0
  9. package/dist/lib/chunk-rolldown-runtime.mjs +24 -0
  10. package/dist/lib/chunk-util.mjs +1758 -0
  11. package/dist/lib/chunk-util.mjs.map +1 -0
  12. package/dist/lib/crypto.mjs +8 -0
  13. package/dist/lib/crypto.mjs.map +1 -0
  14. package/dist/lib/events.mjs +302 -0
  15. package/dist/lib/events.mjs.map +1 -0
  16. package/dist/lib/{browser/fs → fs}/promises.mjs +6 -37
  17. package/dist/lib/fs/promises.mjs.map +1 -0
  18. package/dist/lib/fs.mjs +20 -0
  19. package/dist/lib/fs.mjs.map +1 -0
  20. package/dist/lib/globals.mjs +17 -0
  21. package/dist/lib/globals.mjs.map +1 -0
  22. package/dist/lib/inject-globals.mjs +10 -0
  23. package/dist/lib/inject-globals.mjs.map +1 -0
  24. package/dist/lib/path.mjs +351 -0
  25. package/dist/lib/path.mjs.map +1 -0
  26. package/dist/lib/process.mjs +101 -0
  27. package/dist/lib/process.mjs.map +1 -0
  28. package/dist/lib/stream.mjs +2 -0
  29. package/dist/lib/util.mjs +18 -0
  30. package/dist/lib/util.mjs.map +1 -0
  31. package/dist/types/tsconfig.tsbuildinfo +1 -1
  32. package/package.json +18 -17
  33. package/dist/lib/browser/_/config.mjs +0 -21
  34. package/dist/lib/browser/_/config.mjs.map +0 -7
  35. package/dist/lib/browser/assert.mjs +0 -2069
  36. package/dist/lib/browser/assert.mjs.map +0 -7
  37. package/dist/lib/browser/buffer.mjs +0 -14
  38. package/dist/lib/browser/buffer.mjs.map +0 -7
  39. package/dist/lib/browser/chunk-4QUCD27N.mjs +0 -29
  40. package/dist/lib/browser/chunk-4QUCD27N.mjs.map +0 -7
  41. package/dist/lib/browser/chunk-6GGEUYZ7.mjs +0 -1797
  42. package/dist/lib/browser/chunk-6GGEUYZ7.mjs.map +0 -7
  43. package/dist/lib/browser/chunk-BSSMCHER.mjs +0 -35
  44. package/dist/lib/browser/chunk-BSSMCHER.mjs.map +0 -7
  45. package/dist/lib/browser/chunk-QN6WLX5Z.mjs +0 -111
  46. package/dist/lib/browser/chunk-QN6WLX5Z.mjs.map +0 -7
  47. package/dist/lib/browser/chunk-ZPZXUN32.mjs +0 -2265
  48. package/dist/lib/browser/chunk-ZPZXUN32.mjs.map +0 -7
  49. package/dist/lib/browser/crypto.mjs +0 -10
  50. package/dist/lib/browser/crypto.mjs.map +0 -7
  51. package/dist/lib/browser/events.mjs +0 -383
  52. package/dist/lib/browser/events.mjs.map +0 -7
  53. package/dist/lib/browser/fs/promises.mjs.map +0 -7
  54. package/dist/lib/browser/fs.mjs +0 -27
  55. package/dist/lib/browser/fs.mjs.map +0 -7
  56. package/dist/lib/browser/globals.mjs +0 -5
  57. package/dist/lib/browser/globals.mjs.map +0 -7
  58. package/dist/lib/browser/inject-globals.mjs +0 -20
  59. package/dist/lib/browser/inject-globals.mjs.map +0 -7
  60. package/dist/lib/browser/meta.json +0 -1
  61. package/dist/lib/browser/path.mjs +0 -440
  62. package/dist/lib/browser/path.mjs.map +0 -7
  63. package/dist/lib/browser/process.mjs +0 -8
  64. package/dist/lib/browser/process.mjs.map +0 -7
  65. package/dist/lib/browser/stream.mjs +0 -14
  66. package/dist/lib/browser/stream.mjs.map +0 -7
  67. package/dist/lib/browser/util.mjs +0 -30
  68. package/dist/lib/browser/util.mjs.map +0 -7
@@ -1,2069 +0,0 @@
1
- import {
2
- require_call_bind,
3
- require_define_data_property,
4
- require_has_property_descriptors,
5
- require_util
6
- } from "./chunk-ZPZXUN32.mjs";
7
- import {
8
- __commonJS,
9
- __toESM
10
- } from "./chunk-BSSMCHER.mjs";
11
-
12
- // ../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/internal/errors.js
13
- var require_errors = __commonJS({
14
- "../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/internal/errors.js"(exports, module) {
15
- "use strict";
16
- function _typeof(obj) {
17
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
18
- _typeof = function _typeof2(obj2) {
19
- return typeof obj2;
20
- };
21
- } else {
22
- _typeof = function _typeof2(obj2) {
23
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
24
- };
25
- }
26
- return _typeof(obj);
27
- }
28
- function _classCallCheck(instance, Constructor) {
29
- if (!(instance instanceof Constructor)) {
30
- throw new TypeError("Cannot call a class as a function");
31
- }
32
- }
33
- function _possibleConstructorReturn(self, call) {
34
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
35
- return call;
36
- }
37
- return _assertThisInitialized(self);
38
- }
39
- function _assertThisInitialized(self) {
40
- if (self === void 0) {
41
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
42
- }
43
- return self;
44
- }
45
- function _getPrototypeOf(o) {
46
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
47
- return o2.__proto__ || Object.getPrototypeOf(o2);
48
- };
49
- return _getPrototypeOf(o);
50
- }
51
- function _inherits(subClass, superClass) {
52
- if (typeof superClass !== "function" && superClass !== null) {
53
- throw new TypeError("Super expression must either be null or a function");
54
- }
55
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
56
- if (superClass) _setPrototypeOf(subClass, superClass);
57
- }
58
- function _setPrototypeOf(o, p) {
59
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
60
- o2.__proto__ = p2;
61
- return o2;
62
- };
63
- return _setPrototypeOf(o, p);
64
- }
65
- var codes = {};
66
- var assert2;
67
- var util;
68
- function createErrorType(code, message, Base) {
69
- if (!Base) {
70
- Base = Error;
71
- }
72
- function getMessage(arg1, arg2, arg3) {
73
- if (typeof message === "string") {
74
- return message;
75
- } else {
76
- return message(arg1, arg2, arg3);
77
- }
78
- }
79
- var NodeError = /* @__PURE__ */ (function(_Base) {
80
- _inherits(NodeError2, _Base);
81
- function NodeError2(arg1, arg2, arg3) {
82
- var _this;
83
- _classCallCheck(this, NodeError2);
84
- _this = _possibleConstructorReturn(this, _getPrototypeOf(NodeError2).call(this, getMessage(arg1, arg2, arg3)));
85
- _this.code = code;
86
- return _this;
87
- }
88
- return NodeError2;
89
- })(Base);
90
- codes[code] = NodeError;
91
- }
92
- function oneOf(expected, thing) {
93
- if (Array.isArray(expected)) {
94
- var len = expected.length;
95
- expected = expected.map(function(i) {
96
- return String(i);
97
- });
98
- if (len > 2) {
99
- return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(", "), ", or ") + expected[len - 1];
100
- } else if (len === 2) {
101
- return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
102
- } else {
103
- return "of ".concat(thing, " ").concat(expected[0]);
104
- }
105
- } else {
106
- return "of ".concat(thing, " ").concat(String(expected));
107
- }
108
- }
109
- function startsWith(str, search, pos) {
110
- return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
111
- }
112
- function endsWith(str, search, this_len) {
113
- if (this_len === void 0 || this_len > str.length) {
114
- this_len = str.length;
115
- }
116
- return str.substring(this_len - search.length, this_len) === search;
117
- }
118
- function includes(str, search, start) {
119
- if (typeof start !== "number") {
120
- start = 0;
121
- }
122
- if (start + search.length > str.length) {
123
- return false;
124
- } else {
125
- return str.indexOf(search, start) !== -1;
126
- }
127
- }
128
- createErrorType("ERR_AMBIGUOUS_ARGUMENT", 'The "%s" argument is ambiguous. %s', TypeError);
129
- createErrorType("ERR_INVALID_ARG_TYPE", function(name, expected, actual) {
130
- if (assert2 === void 0) assert2 = require_assert();
131
- assert2(typeof name === "string", "'name' must be a string");
132
- var determiner;
133
- if (typeof expected === "string" && startsWith(expected, "not ")) {
134
- determiner = "must not be";
135
- expected = expected.replace(/^not /, "");
136
- } else {
137
- determiner = "must be";
138
- }
139
- var msg;
140
- if (endsWith(name, " argument")) {
141
- msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
142
- } else {
143
- var type = includes(name, ".") ? "property" : "argument";
144
- msg = 'The "'.concat(name, '" ').concat(type, " ").concat(determiner, " ").concat(oneOf(expected, "type"));
145
- }
146
- msg += ". Received type ".concat(_typeof(actual));
147
- return msg;
148
- }, TypeError);
149
- createErrorType("ERR_INVALID_ARG_VALUE", function(name, value) {
150
- var reason = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "is invalid";
151
- if (util === void 0) util = require_util();
152
- var inspected = util.inspect(value);
153
- if (inspected.length > 128) {
154
- inspected = "".concat(inspected.slice(0, 128), "...");
155
- }
156
- return "The argument '".concat(name, "' ").concat(reason, ". Received ").concat(inspected);
157
- }, TypeError, RangeError);
158
- createErrorType("ERR_INVALID_RETURN_VALUE", function(input, name, value) {
159
- var type;
160
- if (value && value.constructor && value.constructor.name) {
161
- type = "instance of ".concat(value.constructor.name);
162
- } else {
163
- type = "type ".concat(_typeof(value));
164
- }
165
- return "Expected ".concat(input, ' to be returned from the "').concat(name, '"') + " function but got ".concat(type, ".");
166
- }, TypeError);
167
- createErrorType("ERR_MISSING_ARGS", function() {
168
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
169
- args[_key] = arguments[_key];
170
- }
171
- if (assert2 === void 0) assert2 = require_assert();
172
- assert2(args.length > 0, "At least one arg needs to be specified");
173
- var msg = "The ";
174
- var len = args.length;
175
- args = args.map(function(a) {
176
- return '"'.concat(a, '"');
177
- });
178
- switch (len) {
179
- case 1:
180
- msg += "".concat(args[0], " argument");
181
- break;
182
- case 2:
183
- msg += "".concat(args[0], " and ").concat(args[1], " arguments");
184
- break;
185
- default:
186
- msg += args.slice(0, len - 1).join(", ");
187
- msg += ", and ".concat(args[len - 1], " arguments");
188
- break;
189
- }
190
- return "".concat(msg, " must be specified");
191
- }, TypeError);
192
- module.exports.codes = codes;
193
- }
194
- });
195
-
196
- // ../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/internal/assert/assertion_error.js
197
- var require_assertion_error = __commonJS({
198
- "../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/internal/assert/assertion_error.js"(exports, module) {
199
- "use strict";
200
- function _objectSpread(target) {
201
- for (var i = 1; i < arguments.length; i++) {
202
- var source = arguments[i] != null ? arguments[i] : {};
203
- var ownKeys = Object.keys(source);
204
- if (typeof Object.getOwnPropertySymbols === "function") {
205
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
206
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
207
- }));
208
- }
209
- ownKeys.forEach(function(key) {
210
- _defineProperty(target, key, source[key]);
211
- });
212
- }
213
- return target;
214
- }
215
- function _defineProperty(obj, key, value) {
216
- if (key in obj) {
217
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
218
- } else {
219
- obj[key] = value;
220
- }
221
- return obj;
222
- }
223
- function _classCallCheck(instance, Constructor) {
224
- if (!(instance instanceof Constructor)) {
225
- throw new TypeError("Cannot call a class as a function");
226
- }
227
- }
228
- function _defineProperties(target, props) {
229
- for (var i = 0; i < props.length; i++) {
230
- var descriptor = props[i];
231
- descriptor.enumerable = descriptor.enumerable || false;
232
- descriptor.configurable = true;
233
- if ("value" in descriptor) descriptor.writable = true;
234
- Object.defineProperty(target, descriptor.key, descriptor);
235
- }
236
- }
237
- function _createClass(Constructor, protoProps, staticProps) {
238
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
239
- if (staticProps) _defineProperties(Constructor, staticProps);
240
- return Constructor;
241
- }
242
- function _possibleConstructorReturn(self, call) {
243
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
244
- return call;
245
- }
246
- return _assertThisInitialized(self);
247
- }
248
- function _assertThisInitialized(self) {
249
- if (self === void 0) {
250
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
251
- }
252
- return self;
253
- }
254
- function _inherits(subClass, superClass) {
255
- if (typeof superClass !== "function" && superClass !== null) {
256
- throw new TypeError("Super expression must either be null or a function");
257
- }
258
- subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } });
259
- if (superClass) _setPrototypeOf(subClass, superClass);
260
- }
261
- function _wrapNativeSuper(Class) {
262
- var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
263
- _wrapNativeSuper = function _wrapNativeSuper2(Class2) {
264
- if (Class2 === null || !_isNativeFunction(Class2)) return Class2;
265
- if (typeof Class2 !== "function") {
266
- throw new TypeError("Super expression must either be null or a function");
267
- }
268
- if (typeof _cache !== "undefined") {
269
- if (_cache.has(Class2)) return _cache.get(Class2);
270
- _cache.set(Class2, Wrapper);
271
- }
272
- function Wrapper() {
273
- return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
274
- }
275
- Wrapper.prototype = Object.create(Class2.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } });
276
- return _setPrototypeOf(Wrapper, Class2);
277
- };
278
- return _wrapNativeSuper(Class);
279
- }
280
- function isNativeReflectConstruct() {
281
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
282
- if (Reflect.construct.sham) return false;
283
- if (typeof Proxy === "function") return true;
284
- try {
285
- Date.prototype.toString.call(Reflect.construct(Date, [], function() {
286
- }));
287
- return true;
288
- } catch (e) {
289
- return false;
290
- }
291
- }
292
- function _construct(Parent, args, Class) {
293
- if (isNativeReflectConstruct()) {
294
- _construct = Reflect.construct;
295
- } else {
296
- _construct = function _construct2(Parent2, args2, Class2) {
297
- var a = [null];
298
- a.push.apply(a, args2);
299
- var Constructor = Function.bind.apply(Parent2, a);
300
- var instance = new Constructor();
301
- if (Class2) _setPrototypeOf(instance, Class2.prototype);
302
- return instance;
303
- };
304
- }
305
- return _construct.apply(null, arguments);
306
- }
307
- function _isNativeFunction(fn) {
308
- return Function.toString.call(fn).indexOf("[native code]") !== -1;
309
- }
310
- function _setPrototypeOf(o, p) {
311
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
312
- o2.__proto__ = p2;
313
- return o2;
314
- };
315
- return _setPrototypeOf(o, p);
316
- }
317
- function _getPrototypeOf(o) {
318
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
319
- return o2.__proto__ || Object.getPrototypeOf(o2);
320
- };
321
- return _getPrototypeOf(o);
322
- }
323
- function _typeof(obj) {
324
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
325
- _typeof = function _typeof2(obj2) {
326
- return typeof obj2;
327
- };
328
- } else {
329
- _typeof = function _typeof2(obj2) {
330
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
331
- };
332
- }
333
- return _typeof(obj);
334
- }
335
- var _require = require_util();
336
- var inspect = _require.inspect;
337
- var _require2 = require_errors();
338
- var ERR_INVALID_ARG_TYPE = _require2.codes.ERR_INVALID_ARG_TYPE;
339
- function endsWith(str, search, this_len) {
340
- if (this_len === void 0 || this_len > str.length) {
341
- this_len = str.length;
342
- }
343
- return str.substring(this_len - search.length, this_len) === search;
344
- }
345
- function repeat(str, count) {
346
- count = Math.floor(count);
347
- if (str.length == 0 || count == 0) return "";
348
- var maxCount = str.length * count;
349
- count = Math.floor(Math.log(count) / Math.log(2));
350
- while (count) {
351
- str += str;
352
- count--;
353
- }
354
- str += str.substring(0, maxCount - str.length);
355
- return str;
356
- }
357
- var blue = "";
358
- var green = "";
359
- var red = "";
360
- var white = "";
361
- var kReadableOperator = {
362
- deepStrictEqual: "Expected values to be strictly deep-equal:",
363
- strictEqual: "Expected values to be strictly equal:",
364
- strictEqualObject: 'Expected "actual" to be reference-equal to "expected":',
365
- deepEqual: "Expected values to be loosely deep-equal:",
366
- equal: "Expected values to be loosely equal:",
367
- notDeepStrictEqual: 'Expected "actual" not to be strictly deep-equal to:',
368
- notStrictEqual: 'Expected "actual" to be strictly unequal to:',
369
- notStrictEqualObject: 'Expected "actual" not to be reference-equal to "expected":',
370
- notDeepEqual: 'Expected "actual" not to be loosely deep-equal to:',
371
- notEqual: 'Expected "actual" to be loosely unequal to:',
372
- notIdentical: "Values identical but not reference-equal:"
373
- };
374
- var kMaxShortLength = 10;
375
- function copyError(source) {
376
- var keys = Object.keys(source);
377
- var target = Object.create(Object.getPrototypeOf(source));
378
- keys.forEach(function(key) {
379
- target[key] = source[key];
380
- });
381
- Object.defineProperty(target, "message", {
382
- value: source.message
383
- });
384
- return target;
385
- }
386
- function inspectValue(val) {
387
- return inspect(val, {
388
- compact: false,
389
- customInspect: false,
390
- depth: 1e3,
391
- maxArrayLength: Infinity,
392
- // Assert compares only enumerable properties (with a few exceptions).
393
- showHidden: false,
394
- // Having a long line as error is better than wrapping the line for
395
- // comparison for now.
396
- // TODO(BridgeAR): `breakLength` should be limited as soon as soon as we
397
- // have meta information about the inspected properties (i.e., know where
398
- // in what line the property starts and ends).
399
- breakLength: Infinity,
400
- // Assert does not detect proxies currently.
401
- showProxy: false,
402
- sorted: true,
403
- // Inspect getters as we also check them when comparing entries.
404
- getters: true
405
- });
406
- }
407
- function createErrDiff(actual, expected, operator) {
408
- var other = "";
409
- var res = "";
410
- var lastPos = 0;
411
- var end = "";
412
- var skipped = false;
413
- var actualInspected = inspectValue(actual);
414
- var actualLines = actualInspected.split("\n");
415
- var expectedLines = inspectValue(expected).split("\n");
416
- var i = 0;
417
- var indicator = "";
418
- if (operator === "strictEqual" && _typeof(actual) === "object" && _typeof(expected) === "object" && actual !== null && expected !== null) {
419
- operator = "strictEqualObject";
420
- }
421
- if (actualLines.length === 1 && expectedLines.length === 1 && actualLines[0] !== expectedLines[0]) {
422
- var inputLength = actualLines[0].length + expectedLines[0].length;
423
- if (inputLength <= kMaxShortLength) {
424
- if ((_typeof(actual) !== "object" || actual === null) && (_typeof(expected) !== "object" || expected === null) && (actual !== 0 || expected !== 0)) {
425
- return "".concat(kReadableOperator[operator], "\n\n") + "".concat(actualLines[0], " !== ").concat(expectedLines[0], "\n");
426
- }
427
- } else if (operator !== "strictEqualObject") {
428
- var maxLength = process.stderr && process.stderr.isTTY ? process.stderr.columns : 80;
429
- if (inputLength < maxLength) {
430
- while (actualLines[0][i] === expectedLines[0][i]) {
431
- i++;
432
- }
433
- if (i > 2) {
434
- indicator = "\n ".concat(repeat(" ", i), "^");
435
- i = 0;
436
- }
437
- }
438
- }
439
- }
440
- var a = actualLines[actualLines.length - 1];
441
- var b = expectedLines[expectedLines.length - 1];
442
- while (a === b) {
443
- if (i++ < 2) {
444
- end = "\n ".concat(a).concat(end);
445
- } else {
446
- other = a;
447
- }
448
- actualLines.pop();
449
- expectedLines.pop();
450
- if (actualLines.length === 0 || expectedLines.length === 0) break;
451
- a = actualLines[actualLines.length - 1];
452
- b = expectedLines[expectedLines.length - 1];
453
- }
454
- var maxLines = Math.max(actualLines.length, expectedLines.length);
455
- if (maxLines === 0) {
456
- var _actualLines = actualInspected.split("\n");
457
- if (_actualLines.length > 30) {
458
- _actualLines[26] = "".concat(blue, "...").concat(white);
459
- while (_actualLines.length > 27) {
460
- _actualLines.pop();
461
- }
462
- }
463
- return "".concat(kReadableOperator.notIdentical, "\n\n").concat(_actualLines.join("\n"), "\n");
464
- }
465
- if (i > 3) {
466
- end = "\n".concat(blue, "...").concat(white).concat(end);
467
- skipped = true;
468
- }
469
- if (other !== "") {
470
- end = "\n ".concat(other).concat(end);
471
- other = "";
472
- }
473
- var printedLines = 0;
474
- var msg = kReadableOperator[operator] + "\n".concat(green, "+ actual").concat(white, " ").concat(red, "- expected").concat(white);
475
- var skippedMsg = " ".concat(blue, "...").concat(white, " Lines skipped");
476
- for (i = 0; i < maxLines; i++) {
477
- var cur = i - lastPos;
478
- if (actualLines.length < i + 1) {
479
- if (cur > 1 && i > 2) {
480
- if (cur > 4) {
481
- res += "\n".concat(blue, "...").concat(white);
482
- skipped = true;
483
- } else if (cur > 3) {
484
- res += "\n ".concat(expectedLines[i - 2]);
485
- printedLines++;
486
- }
487
- res += "\n ".concat(expectedLines[i - 1]);
488
- printedLines++;
489
- }
490
- lastPos = i;
491
- other += "\n".concat(red, "-").concat(white, " ").concat(expectedLines[i]);
492
- printedLines++;
493
- } else if (expectedLines.length < i + 1) {
494
- if (cur > 1 && i > 2) {
495
- if (cur > 4) {
496
- res += "\n".concat(blue, "...").concat(white);
497
- skipped = true;
498
- } else if (cur > 3) {
499
- res += "\n ".concat(actualLines[i - 2]);
500
- printedLines++;
501
- }
502
- res += "\n ".concat(actualLines[i - 1]);
503
- printedLines++;
504
- }
505
- lastPos = i;
506
- res += "\n".concat(green, "+").concat(white, " ").concat(actualLines[i]);
507
- printedLines++;
508
- } else {
509
- var expectedLine = expectedLines[i];
510
- var actualLine = actualLines[i];
511
- var divergingLines = actualLine !== expectedLine && (!endsWith(actualLine, ",") || actualLine.slice(0, -1) !== expectedLine);
512
- if (divergingLines && endsWith(expectedLine, ",") && expectedLine.slice(0, -1) === actualLine) {
513
- divergingLines = false;
514
- actualLine += ",";
515
- }
516
- if (divergingLines) {
517
- if (cur > 1 && i > 2) {
518
- if (cur > 4) {
519
- res += "\n".concat(blue, "...").concat(white);
520
- skipped = true;
521
- } else if (cur > 3) {
522
- res += "\n ".concat(actualLines[i - 2]);
523
- printedLines++;
524
- }
525
- res += "\n ".concat(actualLines[i - 1]);
526
- printedLines++;
527
- }
528
- lastPos = i;
529
- res += "\n".concat(green, "+").concat(white, " ").concat(actualLine);
530
- other += "\n".concat(red, "-").concat(white, " ").concat(expectedLine);
531
- printedLines += 2;
532
- } else {
533
- res += other;
534
- other = "";
535
- if (cur === 1 || i === 0) {
536
- res += "\n ".concat(actualLine);
537
- printedLines++;
538
- }
539
- }
540
- }
541
- if (printedLines > 20 && i < maxLines - 2) {
542
- return "".concat(msg).concat(skippedMsg, "\n").concat(res, "\n").concat(blue, "...").concat(white).concat(other, "\n") + "".concat(blue, "...").concat(white);
543
- }
544
- }
545
- return "".concat(msg).concat(skipped ? skippedMsg : "", "\n").concat(res).concat(other).concat(end).concat(indicator);
546
- }
547
- var AssertionError = /* @__PURE__ */ (function(_Error) {
548
- _inherits(AssertionError2, _Error);
549
- function AssertionError2(options) {
550
- var _this;
551
- _classCallCheck(this, AssertionError2);
552
- if (_typeof(options) !== "object" || options === null) {
553
- throw new ERR_INVALID_ARG_TYPE("options", "Object", options);
554
- }
555
- var message = options.message, operator = options.operator, stackStartFn = options.stackStartFn;
556
- var actual = options.actual, expected = options.expected;
557
- var limit = Error.stackTraceLimit;
558
- Error.stackTraceLimit = 0;
559
- if (message != null) {
560
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, String(message)));
561
- } else {
562
- if (process.stderr && process.stderr.isTTY) {
563
- if (process.stderr && process.stderr.getColorDepth && process.stderr.getColorDepth() !== 1) {
564
- blue = "\x1B[34m";
565
- green = "\x1B[32m";
566
- white = "\x1B[39m";
567
- red = "\x1B[31m";
568
- } else {
569
- blue = "";
570
- green = "";
571
- white = "";
572
- red = "";
573
- }
574
- }
575
- if (_typeof(actual) === "object" && actual !== null && _typeof(expected) === "object" && expected !== null && "stack" in actual && actual instanceof Error && "stack" in expected && expected instanceof Error) {
576
- actual = copyError(actual);
577
- expected = copyError(expected);
578
- }
579
- if (operator === "deepStrictEqual" || operator === "strictEqual") {
580
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, createErrDiff(actual, expected, operator)));
581
- } else if (operator === "notDeepStrictEqual" || operator === "notStrictEqual") {
582
- var base = kReadableOperator[operator];
583
- var res = inspectValue(actual).split("\n");
584
- if (operator === "notStrictEqual" && _typeof(actual) === "object" && actual !== null) {
585
- base = kReadableOperator.notStrictEqualObject;
586
- }
587
- if (res.length > 30) {
588
- res[26] = "".concat(blue, "...").concat(white);
589
- while (res.length > 27) {
590
- res.pop();
591
- }
592
- }
593
- if (res.length === 1) {
594
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, "".concat(base, " ").concat(res[0])));
595
- } else {
596
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, "".concat(base, "\n\n").concat(res.join("\n"), "\n")));
597
- }
598
- } else {
599
- var _res = inspectValue(actual);
600
- var other = "";
601
- var knownOperators = kReadableOperator[operator];
602
- if (operator === "notDeepEqual" || operator === "notEqual") {
603
- _res = "".concat(kReadableOperator[operator], "\n\n").concat(_res);
604
- if (_res.length > 1024) {
605
- _res = "".concat(_res.slice(0, 1021), "...");
606
- }
607
- } else {
608
- other = "".concat(inspectValue(expected));
609
- if (_res.length > 512) {
610
- _res = "".concat(_res.slice(0, 509), "...");
611
- }
612
- if (other.length > 512) {
613
- other = "".concat(other.slice(0, 509), "...");
614
- }
615
- if (operator === "deepEqual" || operator === "equal") {
616
- _res = "".concat(knownOperators, "\n\n").concat(_res, "\n\nshould equal\n\n");
617
- } else {
618
- other = " ".concat(operator, " ").concat(other);
619
- }
620
- }
621
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AssertionError2).call(this, "".concat(_res).concat(other)));
622
- }
623
- }
624
- Error.stackTraceLimit = limit;
625
- _this.generatedMessage = !message;
626
- Object.defineProperty(_assertThisInitialized(_this), "name", {
627
- value: "AssertionError [ERR_ASSERTION]",
628
- enumerable: false,
629
- writable: true,
630
- configurable: true
631
- });
632
- _this.code = "ERR_ASSERTION";
633
- _this.actual = actual;
634
- _this.expected = expected;
635
- _this.operator = operator;
636
- if (Error.captureStackTrace) {
637
- Error.captureStackTrace(_assertThisInitialized(_this), stackStartFn);
638
- }
639
- _this.stack;
640
- _this.name = "AssertionError";
641
- return _possibleConstructorReturn(_this);
642
- }
643
- _createClass(AssertionError2, [{
644
- key: "toString",
645
- value: function toString() {
646
- return "".concat(this.name, " [").concat(this.code, "]: ").concat(this.message);
647
- }
648
- }, {
649
- key: inspect.custom,
650
- value: function value(recurseTimes, ctx) {
651
- return inspect(this, _objectSpread({}, ctx, {
652
- customInspect: false,
653
- depth: 0
654
- }));
655
- }
656
- }]);
657
- return AssertionError2;
658
- })(_wrapNativeSuper(Error));
659
- module.exports = AssertionError;
660
- }
661
- });
662
-
663
- // ../../../node_modules/.pnpm/es6-object-assign@1.1.0/node_modules/es6-object-assign/index.js
664
- var require_es6_object_assign = __commonJS({
665
- "../../../node_modules/.pnpm/es6-object-assign@1.1.0/node_modules/es6-object-assign/index.js"(exports, module) {
666
- "use strict";
667
- function assign(target, firstSource) {
668
- if (target === void 0 || target === null) {
669
- throw new TypeError("Cannot convert first argument to object");
670
- }
671
- var to = Object(target);
672
- for (var i = 1; i < arguments.length; i++) {
673
- var nextSource = arguments[i];
674
- if (nextSource === void 0 || nextSource === null) {
675
- continue;
676
- }
677
- var keysArray = Object.keys(Object(nextSource));
678
- for (var nextIndex = 0, len = keysArray.length; nextIndex < len; nextIndex++) {
679
- var nextKey = keysArray[nextIndex];
680
- var desc = Object.getOwnPropertyDescriptor(nextSource, nextKey);
681
- if (desc !== void 0 && desc.enumerable) {
682
- to[nextKey] = nextSource[nextKey];
683
- }
684
- }
685
- }
686
- return to;
687
- }
688
- function polyfill() {
689
- if (!Object.assign) {
690
- Object.defineProperty(Object, "assign", {
691
- enumerable: false,
692
- configurable: true,
693
- writable: true,
694
- value: assign
695
- });
696
- }
697
- }
698
- module.exports = {
699
- assign,
700
- polyfill
701
- };
702
- }
703
- });
704
-
705
- // ../../../node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js
706
- var require_isArguments = __commonJS({
707
- "../../../node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/isArguments.js"(exports, module) {
708
- "use strict";
709
- var toStr = Object.prototype.toString;
710
- module.exports = function isArguments(value) {
711
- var str = toStr.call(value);
712
- var isArgs = str === "[object Arguments]";
713
- if (!isArgs) {
714
- isArgs = str !== "[object Array]" && value !== null && typeof value === "object" && typeof value.length === "number" && value.length >= 0 && toStr.call(value.callee) === "[object Function]";
715
- }
716
- return isArgs;
717
- };
718
- }
719
- });
720
-
721
- // ../../../node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js
722
- var require_implementation = __commonJS({
723
- "../../../node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/implementation.js"(exports, module) {
724
- "use strict";
725
- var keysShim;
726
- if (!Object.keys) {
727
- has = Object.prototype.hasOwnProperty;
728
- toStr = Object.prototype.toString;
729
- isArgs = require_isArguments();
730
- isEnumerable = Object.prototype.propertyIsEnumerable;
731
- hasDontEnumBug = !isEnumerable.call({ toString: null }, "toString");
732
- hasProtoEnumBug = isEnumerable.call(function() {
733
- }, "prototype");
734
- dontEnums = [
735
- "toString",
736
- "toLocaleString",
737
- "valueOf",
738
- "hasOwnProperty",
739
- "isPrototypeOf",
740
- "propertyIsEnumerable",
741
- "constructor"
742
- ];
743
- equalsConstructorPrototype = function(o) {
744
- var ctor = o.constructor;
745
- return ctor && ctor.prototype === o;
746
- };
747
- excludedKeys = {
748
- $applicationCache: true,
749
- $console: true,
750
- $external: true,
751
- $frame: true,
752
- $frameElement: true,
753
- $frames: true,
754
- $innerHeight: true,
755
- $innerWidth: true,
756
- $onmozfullscreenchange: true,
757
- $onmozfullscreenerror: true,
758
- $outerHeight: true,
759
- $outerWidth: true,
760
- $pageXOffset: true,
761
- $pageYOffset: true,
762
- $parent: true,
763
- $scrollLeft: true,
764
- $scrollTop: true,
765
- $scrollX: true,
766
- $scrollY: true,
767
- $self: true,
768
- $webkitIndexedDB: true,
769
- $webkitStorageInfo: true,
770
- $window: true
771
- };
772
- hasAutomationEqualityBug = (function() {
773
- if (typeof window === "undefined") {
774
- return false;
775
- }
776
- for (var k in window) {
777
- try {
778
- if (!excludedKeys["$" + k] && has.call(window, k) && window[k] !== null && typeof window[k] === "object") {
779
- try {
780
- equalsConstructorPrototype(window[k]);
781
- } catch (e) {
782
- return true;
783
- }
784
- }
785
- } catch (e) {
786
- return true;
787
- }
788
- }
789
- return false;
790
- })();
791
- equalsConstructorPrototypeIfNotBuggy = function(o) {
792
- if (typeof window === "undefined" || !hasAutomationEqualityBug) {
793
- return equalsConstructorPrototype(o);
794
- }
795
- try {
796
- return equalsConstructorPrototype(o);
797
- } catch (e) {
798
- return false;
799
- }
800
- };
801
- keysShim = function keys(object) {
802
- var isObject = object !== null && typeof object === "object";
803
- var isFunction = toStr.call(object) === "[object Function]";
804
- var isArguments = isArgs(object);
805
- var isString = isObject && toStr.call(object) === "[object String]";
806
- var theKeys = [];
807
- if (!isObject && !isFunction && !isArguments) {
808
- throw new TypeError("Object.keys called on a non-object");
809
- }
810
- var skipProto = hasProtoEnumBug && isFunction;
811
- if (isString && object.length > 0 && !has.call(object, 0)) {
812
- for (var i = 0; i < object.length; ++i) {
813
- theKeys.push(String(i));
814
- }
815
- }
816
- if (isArguments && object.length > 0) {
817
- for (var j = 0; j < object.length; ++j) {
818
- theKeys.push(String(j));
819
- }
820
- } else {
821
- for (var name in object) {
822
- if (!(skipProto && name === "prototype") && has.call(object, name)) {
823
- theKeys.push(String(name));
824
- }
825
- }
826
- }
827
- if (hasDontEnumBug) {
828
- var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
829
- for (var k = 0; k < dontEnums.length; ++k) {
830
- if (!(skipConstructor && dontEnums[k] === "constructor") && has.call(object, dontEnums[k])) {
831
- theKeys.push(dontEnums[k]);
832
- }
833
- }
834
- }
835
- return theKeys;
836
- };
837
- }
838
- var has;
839
- var toStr;
840
- var isArgs;
841
- var isEnumerable;
842
- var hasDontEnumBug;
843
- var hasProtoEnumBug;
844
- var dontEnums;
845
- var equalsConstructorPrototype;
846
- var excludedKeys;
847
- var hasAutomationEqualityBug;
848
- var equalsConstructorPrototypeIfNotBuggy;
849
- module.exports = keysShim;
850
- }
851
- });
852
-
853
- // ../../../node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js
854
- var require_object_keys = __commonJS({
855
- "../../../node_modules/.pnpm/object-keys@1.1.1/node_modules/object-keys/index.js"(exports, module) {
856
- "use strict";
857
- var slice = Array.prototype.slice;
858
- var isArgs = require_isArguments();
859
- var origKeys = Object.keys;
860
- var keysShim = origKeys ? function keys(o) {
861
- return origKeys(o);
862
- } : require_implementation();
863
- var originalKeys = Object.keys;
864
- keysShim.shim = function shimObjectKeys() {
865
- if (Object.keys) {
866
- var keysWorksWithArguments = (function() {
867
- var args = Object.keys(arguments);
868
- return args && args.length === arguments.length;
869
- })(1, 2);
870
- if (!keysWorksWithArguments) {
871
- Object.keys = function keys(object) {
872
- if (isArgs(object)) {
873
- return originalKeys(slice.call(object));
874
- }
875
- return originalKeys(object);
876
- };
877
- }
878
- } else {
879
- Object.keys = keysShim;
880
- }
881
- return Object.keys || keysShim;
882
- };
883
- module.exports = keysShim;
884
- }
885
- });
886
-
887
- // ../../../node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js
888
- var require_define_properties = __commonJS({
889
- "../../../node_modules/.pnpm/define-properties@1.2.1/node_modules/define-properties/index.js"(exports, module) {
890
- "use strict";
891
- var keys = require_object_keys();
892
- var hasSymbols = typeof Symbol === "function" && typeof /* @__PURE__ */ Symbol("foo") === "symbol";
893
- var toStr = Object.prototype.toString;
894
- var concat = Array.prototype.concat;
895
- var defineDataProperty = require_define_data_property();
896
- var isFunction = function(fn) {
897
- return typeof fn === "function" && toStr.call(fn) === "[object Function]";
898
- };
899
- var supportsDescriptors = require_has_property_descriptors()();
900
- var defineProperty = function(object, name, value, predicate) {
901
- if (name in object) {
902
- if (predicate === true) {
903
- if (object[name] === value) {
904
- return;
905
- }
906
- } else if (!isFunction(predicate) || !predicate()) {
907
- return;
908
- }
909
- }
910
- if (supportsDescriptors) {
911
- defineDataProperty(object, name, value, true);
912
- } else {
913
- defineDataProperty(object, name, value);
914
- }
915
- };
916
- var defineProperties = function(object, map) {
917
- var predicates = arguments.length > 2 ? arguments[2] : {};
918
- var props = keys(map);
919
- if (hasSymbols) {
920
- props = concat.call(props, Object.getOwnPropertySymbols(map));
921
- }
922
- for (var i = 0; i < props.length; i += 1) {
923
- defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
924
- }
925
- };
926
- defineProperties.supportsDescriptors = !!supportsDescriptors;
927
- module.exports = defineProperties;
928
- }
929
- });
930
-
931
- // ../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/implementation.js
932
- var require_implementation2 = __commonJS({
933
- "../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/implementation.js"(exports, module) {
934
- "use strict";
935
- var numberIsNaN = function(value) {
936
- return value !== value;
937
- };
938
- module.exports = function is(a, b) {
939
- if (a === 0 && b === 0) {
940
- return 1 / a === 1 / b;
941
- }
942
- if (a === b) {
943
- return true;
944
- }
945
- if (numberIsNaN(a) && numberIsNaN(b)) {
946
- return true;
947
- }
948
- return false;
949
- };
950
- }
951
- });
952
-
953
- // ../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/polyfill.js
954
- var require_polyfill = __commonJS({
955
- "../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/polyfill.js"(exports, module) {
956
- "use strict";
957
- var implementation = require_implementation2();
958
- module.exports = function getPolyfill() {
959
- return typeof Object.is === "function" ? Object.is : implementation;
960
- };
961
- }
962
- });
963
-
964
- // ../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/shim.js
965
- var require_shim = __commonJS({
966
- "../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/shim.js"(exports, module) {
967
- "use strict";
968
- var getPolyfill = require_polyfill();
969
- var define = require_define_properties();
970
- module.exports = function shimObjectIs() {
971
- var polyfill = getPolyfill();
972
- define(Object, { is: polyfill }, {
973
- is: function testObjectIs() {
974
- return Object.is !== polyfill;
975
- }
976
- });
977
- return polyfill;
978
- };
979
- }
980
- });
981
-
982
- // ../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/index.js
983
- var require_object_is = __commonJS({
984
- "../../../node_modules/.pnpm/object-is@1.1.5/node_modules/object-is/index.js"(exports, module) {
985
- "use strict";
986
- var define = require_define_properties();
987
- var callBind = require_call_bind();
988
- var implementation = require_implementation2();
989
- var getPolyfill = require_polyfill();
990
- var shim = require_shim();
991
- var polyfill = callBind(getPolyfill(), Object);
992
- define(polyfill, {
993
- getPolyfill,
994
- implementation,
995
- shim
996
- });
997
- module.exports = polyfill;
998
- }
999
- });
1000
-
1001
- // ../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/implementation.js
1002
- var require_implementation3 = __commonJS({
1003
- "../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/implementation.js"(exports, module) {
1004
- "use strict";
1005
- module.exports = function isNaN(value) {
1006
- return value !== value;
1007
- };
1008
- }
1009
- });
1010
-
1011
- // ../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/polyfill.js
1012
- var require_polyfill2 = __commonJS({
1013
- "../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/polyfill.js"(exports, module) {
1014
- "use strict";
1015
- var implementation = require_implementation3();
1016
- module.exports = function getPolyfill() {
1017
- if (Number.isNaN && Number.isNaN(NaN) && !Number.isNaN("a")) {
1018
- return Number.isNaN;
1019
- }
1020
- return implementation;
1021
- };
1022
- }
1023
- });
1024
-
1025
- // ../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/shim.js
1026
- var require_shim2 = __commonJS({
1027
- "../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/shim.js"(exports, module) {
1028
- "use strict";
1029
- var define = require_define_properties();
1030
- var getPolyfill = require_polyfill2();
1031
- module.exports = function shimNumberIsNaN() {
1032
- var polyfill = getPolyfill();
1033
- define(Number, { isNaN: polyfill }, {
1034
- isNaN: function testIsNaN() {
1035
- return Number.isNaN !== polyfill;
1036
- }
1037
- });
1038
- return polyfill;
1039
- };
1040
- }
1041
- });
1042
-
1043
- // ../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/index.js
1044
- var require_is_nan = __commonJS({
1045
- "../../../node_modules/.pnpm/is-nan@1.3.2/node_modules/is-nan/index.js"(exports, module) {
1046
- "use strict";
1047
- var callBind = require_call_bind();
1048
- var define = require_define_properties();
1049
- var implementation = require_implementation3();
1050
- var getPolyfill = require_polyfill2();
1051
- var shim = require_shim2();
1052
- var polyfill = callBind(getPolyfill(), Number);
1053
- define(polyfill, {
1054
- getPolyfill,
1055
- implementation,
1056
- shim
1057
- });
1058
- module.exports = polyfill;
1059
- }
1060
- });
1061
-
1062
- // ../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/internal/util/comparisons.js
1063
- var require_comparisons = __commonJS({
1064
- "../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/internal/util/comparisons.js"(exports, module) {
1065
- "use strict";
1066
- function _slicedToArray(arr, i) {
1067
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
1068
- }
1069
- function _nonIterableRest() {
1070
- throw new TypeError("Invalid attempt to destructure non-iterable instance");
1071
- }
1072
- function _iterableToArrayLimit(arr, i) {
1073
- var _arr = [];
1074
- var _n = true;
1075
- var _d = false;
1076
- var _e = void 0;
1077
- try {
1078
- for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
1079
- _arr.push(_s.value);
1080
- if (i && _arr.length === i) break;
1081
- }
1082
- } catch (err) {
1083
- _d = true;
1084
- _e = err;
1085
- } finally {
1086
- try {
1087
- if (!_n && _i["return"] != null) _i["return"]();
1088
- } finally {
1089
- if (_d) throw _e;
1090
- }
1091
- }
1092
- return _arr;
1093
- }
1094
- function _arrayWithHoles(arr) {
1095
- if (Array.isArray(arr)) return arr;
1096
- }
1097
- function _typeof(obj) {
1098
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1099
- _typeof = function _typeof2(obj2) {
1100
- return typeof obj2;
1101
- };
1102
- } else {
1103
- _typeof = function _typeof2(obj2) {
1104
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1105
- };
1106
- }
1107
- return _typeof(obj);
1108
- }
1109
- var regexFlagsSupported = /a/g.flags !== void 0;
1110
- var arrayFromSet = function arrayFromSet2(set) {
1111
- var array = [];
1112
- set.forEach(function(value) {
1113
- return array.push(value);
1114
- });
1115
- return array;
1116
- };
1117
- var arrayFromMap = function arrayFromMap2(map) {
1118
- var array = [];
1119
- map.forEach(function(value, key) {
1120
- return array.push([key, value]);
1121
- });
1122
- return array;
1123
- };
1124
- var objectIs = Object.is ? Object.is : require_object_is();
1125
- var objectGetOwnPropertySymbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols : function() {
1126
- return [];
1127
- };
1128
- var numberIsNaN = Number.isNaN ? Number.isNaN : require_is_nan();
1129
- function uncurryThis(f) {
1130
- return f.call.bind(f);
1131
- }
1132
- var hasOwnProperty = uncurryThis(Object.prototype.hasOwnProperty);
1133
- var propertyIsEnumerable = uncurryThis(Object.prototype.propertyIsEnumerable);
1134
- var objectToString = uncurryThis(Object.prototype.toString);
1135
- var _require$types = require_util().types;
1136
- var isAnyArrayBuffer = _require$types.isAnyArrayBuffer;
1137
- var isArrayBufferView = _require$types.isArrayBufferView;
1138
- var isDate = _require$types.isDate;
1139
- var isMap = _require$types.isMap;
1140
- var isRegExp = _require$types.isRegExp;
1141
- var isSet = _require$types.isSet;
1142
- var isNativeError = _require$types.isNativeError;
1143
- var isBoxedPrimitive = _require$types.isBoxedPrimitive;
1144
- var isNumberObject = _require$types.isNumberObject;
1145
- var isStringObject = _require$types.isStringObject;
1146
- var isBooleanObject = _require$types.isBooleanObject;
1147
- var isBigIntObject = _require$types.isBigIntObject;
1148
- var isSymbolObject = _require$types.isSymbolObject;
1149
- var isFloat32Array = _require$types.isFloat32Array;
1150
- var isFloat64Array = _require$types.isFloat64Array;
1151
- function isNonIndex(key) {
1152
- if (key.length === 0 || key.length > 10) return true;
1153
- for (var i = 0; i < key.length; i++) {
1154
- var code = key.charCodeAt(i);
1155
- if (code < 48 || code > 57) return true;
1156
- }
1157
- return key.length === 10 && key >= Math.pow(2, 32);
1158
- }
1159
- function getOwnNonIndexProperties(value) {
1160
- return Object.keys(value).filter(isNonIndex).concat(objectGetOwnPropertySymbols(value).filter(Object.prototype.propertyIsEnumerable.bind(value)));
1161
- }
1162
- function compare(a, b) {
1163
- if (a === b) {
1164
- return 0;
1165
- }
1166
- var x = a.length;
1167
- var y = b.length;
1168
- for (var i = 0, len = Math.min(x, y); i < len; ++i) {
1169
- if (a[i] !== b[i]) {
1170
- x = a[i];
1171
- y = b[i];
1172
- break;
1173
- }
1174
- }
1175
- if (x < y) {
1176
- return -1;
1177
- }
1178
- if (y < x) {
1179
- return 1;
1180
- }
1181
- return 0;
1182
- }
1183
- var ONLY_ENUMERABLE = void 0;
1184
- var kStrict = true;
1185
- var kLoose = false;
1186
- var kNoIterator = 0;
1187
- var kIsArray = 1;
1188
- var kIsSet = 2;
1189
- var kIsMap = 3;
1190
- function areSimilarRegExps(a, b) {
1191
- return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);
1192
- }
1193
- function areSimilarFloatArrays(a, b) {
1194
- if (a.byteLength !== b.byteLength) {
1195
- return false;
1196
- }
1197
- for (var offset = 0; offset < a.byteLength; offset++) {
1198
- if (a[offset] !== b[offset]) {
1199
- return false;
1200
- }
1201
- }
1202
- return true;
1203
- }
1204
- function areSimilarTypedArrays(a, b) {
1205
- if (a.byteLength !== b.byteLength) {
1206
- return false;
1207
- }
1208
- return compare(new Uint8Array(a.buffer, a.byteOffset, a.byteLength), new Uint8Array(b.buffer, b.byteOffset, b.byteLength)) === 0;
1209
- }
1210
- function areEqualArrayBuffers(buf1, buf2) {
1211
- return buf1.byteLength === buf2.byteLength && compare(new Uint8Array(buf1), new Uint8Array(buf2)) === 0;
1212
- }
1213
- function isEqualBoxedPrimitive(val1, val2) {
1214
- if (isNumberObject(val1)) {
1215
- return isNumberObject(val2) && objectIs(Number.prototype.valueOf.call(val1), Number.prototype.valueOf.call(val2));
1216
- }
1217
- if (isStringObject(val1)) {
1218
- return isStringObject(val2) && String.prototype.valueOf.call(val1) === String.prototype.valueOf.call(val2);
1219
- }
1220
- if (isBooleanObject(val1)) {
1221
- return isBooleanObject(val2) && Boolean.prototype.valueOf.call(val1) === Boolean.prototype.valueOf.call(val2);
1222
- }
1223
- if (isBigIntObject(val1)) {
1224
- return isBigIntObject(val2) && BigInt.prototype.valueOf.call(val1) === BigInt.prototype.valueOf.call(val2);
1225
- }
1226
- return isSymbolObject(val2) && Symbol.prototype.valueOf.call(val1) === Symbol.prototype.valueOf.call(val2);
1227
- }
1228
- function innerDeepEqual(val1, val2, strict, memos) {
1229
- if (val1 === val2) {
1230
- if (val1 !== 0) return true;
1231
- return strict ? objectIs(val1, val2) : true;
1232
- }
1233
- if (strict) {
1234
- if (_typeof(val1) !== "object") {
1235
- return typeof val1 === "number" && numberIsNaN(val1) && numberIsNaN(val2);
1236
- }
1237
- if (_typeof(val2) !== "object" || val1 === null || val2 === null) {
1238
- return false;
1239
- }
1240
- if (Object.getPrototypeOf(val1) !== Object.getPrototypeOf(val2)) {
1241
- return false;
1242
- }
1243
- } else {
1244
- if (val1 === null || _typeof(val1) !== "object") {
1245
- if (val2 === null || _typeof(val2) !== "object") {
1246
- return val1 == val2;
1247
- }
1248
- return false;
1249
- }
1250
- if (val2 === null || _typeof(val2) !== "object") {
1251
- return false;
1252
- }
1253
- }
1254
- var val1Tag = objectToString(val1);
1255
- var val2Tag = objectToString(val2);
1256
- if (val1Tag !== val2Tag) {
1257
- return false;
1258
- }
1259
- if (Array.isArray(val1)) {
1260
- if (val1.length !== val2.length) {
1261
- return false;
1262
- }
1263
- var keys1 = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
1264
- var keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
1265
- if (keys1.length !== keys2.length) {
1266
- return false;
1267
- }
1268
- return keyCheck(val1, val2, strict, memos, kIsArray, keys1);
1269
- }
1270
- if (val1Tag === "[object Object]") {
1271
- if (!isMap(val1) && isMap(val2) || !isSet(val1) && isSet(val2)) {
1272
- return false;
1273
- }
1274
- }
1275
- if (isDate(val1)) {
1276
- if (!isDate(val2) || Date.prototype.getTime.call(val1) !== Date.prototype.getTime.call(val2)) {
1277
- return false;
1278
- }
1279
- } else if (isRegExp(val1)) {
1280
- if (!isRegExp(val2) || !areSimilarRegExps(val1, val2)) {
1281
- return false;
1282
- }
1283
- } else if (isNativeError(val1) || val1 instanceof Error) {
1284
- if (val1.message !== val2.message || val1.name !== val2.name) {
1285
- return false;
1286
- }
1287
- } else if (isArrayBufferView(val1)) {
1288
- if (!strict && (isFloat32Array(val1) || isFloat64Array(val1))) {
1289
- if (!areSimilarFloatArrays(val1, val2)) {
1290
- return false;
1291
- }
1292
- } else if (!areSimilarTypedArrays(val1, val2)) {
1293
- return false;
1294
- }
1295
- var _keys = getOwnNonIndexProperties(val1, ONLY_ENUMERABLE);
1296
- var _keys2 = getOwnNonIndexProperties(val2, ONLY_ENUMERABLE);
1297
- if (_keys.length !== _keys2.length) {
1298
- return false;
1299
- }
1300
- return keyCheck(val1, val2, strict, memos, kNoIterator, _keys);
1301
- } else if (isSet(val1)) {
1302
- if (!isSet(val2) || val1.size !== val2.size) {
1303
- return false;
1304
- }
1305
- return keyCheck(val1, val2, strict, memos, kIsSet);
1306
- } else if (isMap(val1)) {
1307
- if (!isMap(val2) || val1.size !== val2.size) {
1308
- return false;
1309
- }
1310
- return keyCheck(val1, val2, strict, memos, kIsMap);
1311
- } else if (isAnyArrayBuffer(val1)) {
1312
- if (!areEqualArrayBuffers(val1, val2)) {
1313
- return false;
1314
- }
1315
- } else if (isBoxedPrimitive(val1) && !isEqualBoxedPrimitive(val1, val2)) {
1316
- return false;
1317
- }
1318
- return keyCheck(val1, val2, strict, memos, kNoIterator);
1319
- }
1320
- function getEnumerables(val, keys) {
1321
- return keys.filter(function(k) {
1322
- return propertyIsEnumerable(val, k);
1323
- });
1324
- }
1325
- function keyCheck(val1, val2, strict, memos, iterationType, aKeys) {
1326
- if (arguments.length === 5) {
1327
- aKeys = Object.keys(val1);
1328
- var bKeys = Object.keys(val2);
1329
- if (aKeys.length !== bKeys.length) {
1330
- return false;
1331
- }
1332
- }
1333
- var i = 0;
1334
- for (; i < aKeys.length; i++) {
1335
- if (!hasOwnProperty(val2, aKeys[i])) {
1336
- return false;
1337
- }
1338
- }
1339
- if (strict && arguments.length === 5) {
1340
- var symbolKeysA = objectGetOwnPropertySymbols(val1);
1341
- if (symbolKeysA.length !== 0) {
1342
- var count = 0;
1343
- for (i = 0; i < symbolKeysA.length; i++) {
1344
- var key = symbolKeysA[i];
1345
- if (propertyIsEnumerable(val1, key)) {
1346
- if (!propertyIsEnumerable(val2, key)) {
1347
- return false;
1348
- }
1349
- aKeys.push(key);
1350
- count++;
1351
- } else if (propertyIsEnumerable(val2, key)) {
1352
- return false;
1353
- }
1354
- }
1355
- var symbolKeysB = objectGetOwnPropertySymbols(val2);
1356
- if (symbolKeysA.length !== symbolKeysB.length && getEnumerables(val2, symbolKeysB).length !== count) {
1357
- return false;
1358
- }
1359
- } else {
1360
- var _symbolKeysB = objectGetOwnPropertySymbols(val2);
1361
- if (_symbolKeysB.length !== 0 && getEnumerables(val2, _symbolKeysB).length !== 0) {
1362
- return false;
1363
- }
1364
- }
1365
- }
1366
- if (aKeys.length === 0 && (iterationType === kNoIterator || iterationType === kIsArray && val1.length === 0 || val1.size === 0)) {
1367
- return true;
1368
- }
1369
- if (memos === void 0) {
1370
- memos = {
1371
- val1: /* @__PURE__ */ new Map(),
1372
- val2: /* @__PURE__ */ new Map(),
1373
- position: 0
1374
- };
1375
- } else {
1376
- var val2MemoA = memos.val1.get(val1);
1377
- if (val2MemoA !== void 0) {
1378
- var val2MemoB = memos.val2.get(val2);
1379
- if (val2MemoB !== void 0) {
1380
- return val2MemoA === val2MemoB;
1381
- }
1382
- }
1383
- memos.position++;
1384
- }
1385
- memos.val1.set(val1, memos.position);
1386
- memos.val2.set(val2, memos.position);
1387
- var areEq = objEquiv(val1, val2, strict, aKeys, memos, iterationType);
1388
- memos.val1.delete(val1);
1389
- memos.val2.delete(val2);
1390
- return areEq;
1391
- }
1392
- function setHasEqualElement(set, val1, strict, memo) {
1393
- var setValues = arrayFromSet(set);
1394
- for (var i = 0; i < setValues.length; i++) {
1395
- var val2 = setValues[i];
1396
- if (innerDeepEqual(val1, val2, strict, memo)) {
1397
- set.delete(val2);
1398
- return true;
1399
- }
1400
- }
1401
- return false;
1402
- }
1403
- function findLooseMatchingPrimitives(prim) {
1404
- switch (_typeof(prim)) {
1405
- case "undefined":
1406
- return null;
1407
- case "object":
1408
- return void 0;
1409
- case "symbol":
1410
- return false;
1411
- case "string":
1412
- prim = +prim;
1413
- // Loose equal entries exist only if the string is possible to convert to
1414
- // a regular number and not NaN.
1415
- // Fall through
1416
- case "number":
1417
- if (numberIsNaN(prim)) {
1418
- return false;
1419
- }
1420
- }
1421
- return true;
1422
- }
1423
- function setMightHaveLoosePrim(a, b, prim) {
1424
- var altValue = findLooseMatchingPrimitives(prim);
1425
- if (altValue != null) return altValue;
1426
- return b.has(altValue) && !a.has(altValue);
1427
- }
1428
- function mapMightHaveLoosePrim(a, b, prim, item, memo) {
1429
- var altValue = findLooseMatchingPrimitives(prim);
1430
- if (altValue != null) {
1431
- return altValue;
1432
- }
1433
- var curB = b.get(altValue);
1434
- if (curB === void 0 && !b.has(altValue) || !innerDeepEqual(item, curB, false, memo)) {
1435
- return false;
1436
- }
1437
- return !a.has(altValue) && innerDeepEqual(item, curB, false, memo);
1438
- }
1439
- function setEquiv(a, b, strict, memo) {
1440
- var set = null;
1441
- var aValues = arrayFromSet(a);
1442
- for (var i = 0; i < aValues.length; i++) {
1443
- var val = aValues[i];
1444
- if (_typeof(val) === "object" && val !== null) {
1445
- if (set === null) {
1446
- set = /* @__PURE__ */ new Set();
1447
- }
1448
- set.add(val);
1449
- } else if (!b.has(val)) {
1450
- if (strict) return false;
1451
- if (!setMightHaveLoosePrim(a, b, val)) {
1452
- return false;
1453
- }
1454
- if (set === null) {
1455
- set = /* @__PURE__ */ new Set();
1456
- }
1457
- set.add(val);
1458
- }
1459
- }
1460
- if (set !== null) {
1461
- var bValues = arrayFromSet(b);
1462
- for (var _i = 0; _i < bValues.length; _i++) {
1463
- var _val = bValues[_i];
1464
- if (_typeof(_val) === "object" && _val !== null) {
1465
- if (!setHasEqualElement(set, _val, strict, memo)) return false;
1466
- } else if (!strict && !a.has(_val) && !setHasEqualElement(set, _val, strict, memo)) {
1467
- return false;
1468
- }
1469
- }
1470
- return set.size === 0;
1471
- }
1472
- return true;
1473
- }
1474
- function mapHasEqualEntry(set, map, key1, item1, strict, memo) {
1475
- var setValues = arrayFromSet(set);
1476
- for (var i = 0; i < setValues.length; i++) {
1477
- var key2 = setValues[i];
1478
- if (innerDeepEqual(key1, key2, strict, memo) && innerDeepEqual(item1, map.get(key2), strict, memo)) {
1479
- set.delete(key2);
1480
- return true;
1481
- }
1482
- }
1483
- return false;
1484
- }
1485
- function mapEquiv(a, b, strict, memo) {
1486
- var set = null;
1487
- var aEntries = arrayFromMap(a);
1488
- for (var i = 0; i < aEntries.length; i++) {
1489
- var _aEntries$i = _slicedToArray(aEntries[i], 2), key = _aEntries$i[0], item1 = _aEntries$i[1];
1490
- if (_typeof(key) === "object" && key !== null) {
1491
- if (set === null) {
1492
- set = /* @__PURE__ */ new Set();
1493
- }
1494
- set.add(key);
1495
- } else {
1496
- var item2 = b.get(key);
1497
- if (item2 === void 0 && !b.has(key) || !innerDeepEqual(item1, item2, strict, memo)) {
1498
- if (strict) return false;
1499
- if (!mapMightHaveLoosePrim(a, b, key, item1, memo)) return false;
1500
- if (set === null) {
1501
- set = /* @__PURE__ */ new Set();
1502
- }
1503
- set.add(key);
1504
- }
1505
- }
1506
- }
1507
- if (set !== null) {
1508
- var bEntries = arrayFromMap(b);
1509
- for (var _i2 = 0; _i2 < bEntries.length; _i2++) {
1510
- var _bEntries$_i = _slicedToArray(bEntries[_i2], 2), key = _bEntries$_i[0], item = _bEntries$_i[1];
1511
- if (_typeof(key) === "object" && key !== null) {
1512
- if (!mapHasEqualEntry(set, a, key, item, strict, memo)) return false;
1513
- } else if (!strict && (!a.has(key) || !innerDeepEqual(a.get(key), item, false, memo)) && !mapHasEqualEntry(set, a, key, item, false, memo)) {
1514
- return false;
1515
- }
1516
- }
1517
- return set.size === 0;
1518
- }
1519
- return true;
1520
- }
1521
- function objEquiv(a, b, strict, keys, memos, iterationType) {
1522
- var i = 0;
1523
- if (iterationType === kIsSet) {
1524
- if (!setEquiv(a, b, strict, memos)) {
1525
- return false;
1526
- }
1527
- } else if (iterationType === kIsMap) {
1528
- if (!mapEquiv(a, b, strict, memos)) {
1529
- return false;
1530
- }
1531
- } else if (iterationType === kIsArray) {
1532
- for (; i < a.length; i++) {
1533
- if (hasOwnProperty(a, i)) {
1534
- if (!hasOwnProperty(b, i) || !innerDeepEqual(a[i], b[i], strict, memos)) {
1535
- return false;
1536
- }
1537
- } else if (hasOwnProperty(b, i)) {
1538
- return false;
1539
- } else {
1540
- var keysA = Object.keys(a);
1541
- for (; i < keysA.length; i++) {
1542
- var key = keysA[i];
1543
- if (!hasOwnProperty(b, key) || !innerDeepEqual(a[key], b[key], strict, memos)) {
1544
- return false;
1545
- }
1546
- }
1547
- if (keysA.length !== Object.keys(b).length) {
1548
- return false;
1549
- }
1550
- return true;
1551
- }
1552
- }
1553
- }
1554
- for (i = 0; i < keys.length; i++) {
1555
- var _key = keys[i];
1556
- if (!innerDeepEqual(a[_key], b[_key], strict, memos)) {
1557
- return false;
1558
- }
1559
- }
1560
- return true;
1561
- }
1562
- function isDeepEqual(val1, val2) {
1563
- return innerDeepEqual(val1, val2, kLoose);
1564
- }
1565
- function isDeepStrictEqual(val1, val2) {
1566
- return innerDeepEqual(val1, val2, kStrict);
1567
- }
1568
- module.exports = {
1569
- isDeepEqual,
1570
- isDeepStrictEqual
1571
- };
1572
- }
1573
- });
1574
-
1575
- // ../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/assert.js
1576
- var require_assert = __commonJS({
1577
- "../../../node_modules/.pnpm/assert@2.0.0/node_modules/assert/build/assert.js"(exports, module) {
1578
- "use strict";
1579
- function _typeof(obj) {
1580
- if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
1581
- _typeof = function _typeof2(obj2) {
1582
- return typeof obj2;
1583
- };
1584
- } else {
1585
- _typeof = function _typeof2(obj2) {
1586
- return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
1587
- };
1588
- }
1589
- return _typeof(obj);
1590
- }
1591
- function _classCallCheck(instance, Constructor) {
1592
- if (!(instance instanceof Constructor)) {
1593
- throw new TypeError("Cannot call a class as a function");
1594
- }
1595
- }
1596
- var _require = require_errors();
1597
- var _require$codes = _require.codes;
1598
- var ERR_AMBIGUOUS_ARGUMENT = _require$codes.ERR_AMBIGUOUS_ARGUMENT;
1599
- var ERR_INVALID_ARG_TYPE = _require$codes.ERR_INVALID_ARG_TYPE;
1600
- var ERR_INVALID_ARG_VALUE = _require$codes.ERR_INVALID_ARG_VALUE;
1601
- var ERR_INVALID_RETURN_VALUE = _require$codes.ERR_INVALID_RETURN_VALUE;
1602
- var ERR_MISSING_ARGS = _require$codes.ERR_MISSING_ARGS;
1603
- var AssertionError = require_assertion_error();
1604
- var _require2 = require_util();
1605
- var inspect = _require2.inspect;
1606
- var _require$types = require_util().types;
1607
- var isPromise = _require$types.isPromise;
1608
- var isRegExp = _require$types.isRegExp;
1609
- var objectAssign = Object.assign ? Object.assign : require_es6_object_assign().assign;
1610
- var objectIs = Object.is ? Object.is : require_object_is();
1611
- var isDeepEqual;
1612
- var isDeepStrictEqual;
1613
- function lazyLoadComparison() {
1614
- var comparison = require_comparisons();
1615
- isDeepEqual = comparison.isDeepEqual;
1616
- isDeepStrictEqual = comparison.isDeepStrictEqual;
1617
- }
1618
- var warned = false;
1619
- var assert2 = module.exports = ok;
1620
- var NO_EXCEPTION_SENTINEL = {};
1621
- function innerFail(obj) {
1622
- if (obj.message instanceof Error) throw obj.message;
1623
- throw new AssertionError(obj);
1624
- }
1625
- function fail(actual, expected, message, operator, stackStartFn) {
1626
- var argsLen = arguments.length;
1627
- var internalMessage;
1628
- if (argsLen === 0) {
1629
- internalMessage = "Failed";
1630
- } else if (argsLen === 1) {
1631
- message = actual;
1632
- actual = void 0;
1633
- } else {
1634
- if (warned === false) {
1635
- warned = true;
1636
- var warn = process.emitWarning ? process.emitWarning : console.warn.bind(console);
1637
- warn("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.", "DeprecationWarning", "DEP0094");
1638
- }
1639
- if (argsLen === 2) operator = "!=";
1640
- }
1641
- if (message instanceof Error) throw message;
1642
- var errArgs = {
1643
- actual,
1644
- expected,
1645
- operator: operator === void 0 ? "fail" : operator,
1646
- stackStartFn: stackStartFn || fail
1647
- };
1648
- if (message !== void 0) {
1649
- errArgs.message = message;
1650
- }
1651
- var err = new AssertionError(errArgs);
1652
- if (internalMessage) {
1653
- err.message = internalMessage;
1654
- err.generatedMessage = true;
1655
- }
1656
- throw err;
1657
- }
1658
- assert2.fail = fail;
1659
- assert2.AssertionError = AssertionError;
1660
- function innerOk(fn, argLen, value, message) {
1661
- if (!value) {
1662
- var generatedMessage = false;
1663
- if (argLen === 0) {
1664
- generatedMessage = true;
1665
- message = "No value argument passed to `assert.ok()`";
1666
- } else if (message instanceof Error) {
1667
- throw message;
1668
- }
1669
- var err = new AssertionError({
1670
- actual: value,
1671
- expected: true,
1672
- message,
1673
- operator: "==",
1674
- stackStartFn: fn
1675
- });
1676
- err.generatedMessage = generatedMessage;
1677
- throw err;
1678
- }
1679
- }
1680
- function ok() {
1681
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1682
- args[_key] = arguments[_key];
1683
- }
1684
- innerOk.apply(void 0, [ok, args.length].concat(args));
1685
- }
1686
- assert2.ok = ok;
1687
- assert2.equal = function equal(actual, expected, message) {
1688
- if (arguments.length < 2) {
1689
- throw new ERR_MISSING_ARGS("actual", "expected");
1690
- }
1691
- if (actual != expected) {
1692
- innerFail({
1693
- actual,
1694
- expected,
1695
- message,
1696
- operator: "==",
1697
- stackStartFn: equal
1698
- });
1699
- }
1700
- };
1701
- assert2.notEqual = function notEqual(actual, expected, message) {
1702
- if (arguments.length < 2) {
1703
- throw new ERR_MISSING_ARGS("actual", "expected");
1704
- }
1705
- if (actual == expected) {
1706
- innerFail({
1707
- actual,
1708
- expected,
1709
- message,
1710
- operator: "!=",
1711
- stackStartFn: notEqual
1712
- });
1713
- }
1714
- };
1715
- assert2.deepEqual = function deepEqual(actual, expected, message) {
1716
- if (arguments.length < 2) {
1717
- throw new ERR_MISSING_ARGS("actual", "expected");
1718
- }
1719
- if (isDeepEqual === void 0) lazyLoadComparison();
1720
- if (!isDeepEqual(actual, expected)) {
1721
- innerFail({
1722
- actual,
1723
- expected,
1724
- message,
1725
- operator: "deepEqual",
1726
- stackStartFn: deepEqual
1727
- });
1728
- }
1729
- };
1730
- assert2.notDeepEqual = function notDeepEqual(actual, expected, message) {
1731
- if (arguments.length < 2) {
1732
- throw new ERR_MISSING_ARGS("actual", "expected");
1733
- }
1734
- if (isDeepEqual === void 0) lazyLoadComparison();
1735
- if (isDeepEqual(actual, expected)) {
1736
- innerFail({
1737
- actual,
1738
- expected,
1739
- message,
1740
- operator: "notDeepEqual",
1741
- stackStartFn: notDeepEqual
1742
- });
1743
- }
1744
- };
1745
- assert2.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
1746
- if (arguments.length < 2) {
1747
- throw new ERR_MISSING_ARGS("actual", "expected");
1748
- }
1749
- if (isDeepEqual === void 0) lazyLoadComparison();
1750
- if (!isDeepStrictEqual(actual, expected)) {
1751
- innerFail({
1752
- actual,
1753
- expected,
1754
- message,
1755
- operator: "deepStrictEqual",
1756
- stackStartFn: deepStrictEqual
1757
- });
1758
- }
1759
- };
1760
- assert2.notDeepStrictEqual = notDeepStrictEqual;
1761
- function notDeepStrictEqual(actual, expected, message) {
1762
- if (arguments.length < 2) {
1763
- throw new ERR_MISSING_ARGS("actual", "expected");
1764
- }
1765
- if (isDeepEqual === void 0) lazyLoadComparison();
1766
- if (isDeepStrictEqual(actual, expected)) {
1767
- innerFail({
1768
- actual,
1769
- expected,
1770
- message,
1771
- operator: "notDeepStrictEqual",
1772
- stackStartFn: notDeepStrictEqual
1773
- });
1774
- }
1775
- }
1776
- assert2.strictEqual = function strictEqual(actual, expected, message) {
1777
- if (arguments.length < 2) {
1778
- throw new ERR_MISSING_ARGS("actual", "expected");
1779
- }
1780
- if (!objectIs(actual, expected)) {
1781
- innerFail({
1782
- actual,
1783
- expected,
1784
- message,
1785
- operator: "strictEqual",
1786
- stackStartFn: strictEqual
1787
- });
1788
- }
1789
- };
1790
- assert2.notStrictEqual = function notStrictEqual(actual, expected, message) {
1791
- if (arguments.length < 2) {
1792
- throw new ERR_MISSING_ARGS("actual", "expected");
1793
- }
1794
- if (objectIs(actual, expected)) {
1795
- innerFail({
1796
- actual,
1797
- expected,
1798
- message,
1799
- operator: "notStrictEqual",
1800
- stackStartFn: notStrictEqual
1801
- });
1802
- }
1803
- };
1804
- var Comparison = function Comparison2(obj, keys, actual) {
1805
- var _this = this;
1806
- _classCallCheck(this, Comparison2);
1807
- keys.forEach(function(key) {
1808
- if (key in obj) {
1809
- if (actual !== void 0 && typeof actual[key] === "string" && isRegExp(obj[key]) && obj[key].test(actual[key])) {
1810
- _this[key] = actual[key];
1811
- } else {
1812
- _this[key] = obj[key];
1813
- }
1814
- }
1815
- });
1816
- };
1817
- function compareExceptionKey(actual, expected, key, message, keys, fn) {
1818
- if (!(key in actual) || !isDeepStrictEqual(actual[key], expected[key])) {
1819
- if (!message) {
1820
- var a = new Comparison(actual, keys);
1821
- var b = new Comparison(expected, keys, actual);
1822
- var err = new AssertionError({
1823
- actual: a,
1824
- expected: b,
1825
- operator: "deepStrictEqual",
1826
- stackStartFn: fn
1827
- });
1828
- err.actual = actual;
1829
- err.expected = expected;
1830
- err.operator = fn.name;
1831
- throw err;
1832
- }
1833
- innerFail({
1834
- actual,
1835
- expected,
1836
- message,
1837
- operator: fn.name,
1838
- stackStartFn: fn
1839
- });
1840
- }
1841
- }
1842
- function expectedException(actual, expected, msg, fn) {
1843
- if (typeof expected !== "function") {
1844
- if (isRegExp(expected)) return expected.test(actual);
1845
- if (arguments.length === 2) {
1846
- throw new ERR_INVALID_ARG_TYPE("expected", ["Function", "RegExp"], expected);
1847
- }
1848
- if (_typeof(actual) !== "object" || actual === null) {
1849
- var err = new AssertionError({
1850
- actual,
1851
- expected,
1852
- message: msg,
1853
- operator: "deepStrictEqual",
1854
- stackStartFn: fn
1855
- });
1856
- err.operator = fn.name;
1857
- throw err;
1858
- }
1859
- var keys = Object.keys(expected);
1860
- if (expected instanceof Error) {
1861
- keys.push("name", "message");
1862
- } else if (keys.length === 0) {
1863
- throw new ERR_INVALID_ARG_VALUE("error", expected, "may not be an empty object");
1864
- }
1865
- if (isDeepEqual === void 0) lazyLoadComparison();
1866
- keys.forEach(function(key) {
1867
- if (typeof actual[key] === "string" && isRegExp(expected[key]) && expected[key].test(actual[key])) {
1868
- return;
1869
- }
1870
- compareExceptionKey(actual, expected, key, msg, keys, fn);
1871
- });
1872
- return true;
1873
- }
1874
- if (expected.prototype !== void 0 && actual instanceof expected) {
1875
- return true;
1876
- }
1877
- if (Error.isPrototypeOf(expected)) {
1878
- return false;
1879
- }
1880
- return expected.call({}, actual) === true;
1881
- }
1882
- function getActual(fn) {
1883
- if (typeof fn !== "function") {
1884
- throw new ERR_INVALID_ARG_TYPE("fn", "Function", fn);
1885
- }
1886
- try {
1887
- fn();
1888
- } catch (e) {
1889
- return e;
1890
- }
1891
- return NO_EXCEPTION_SENTINEL;
1892
- }
1893
- function checkIsPromise(obj) {
1894
- return isPromise(obj) || obj !== null && _typeof(obj) === "object" && typeof obj.then === "function" && typeof obj.catch === "function";
1895
- }
1896
- function waitForActual(promiseFn) {
1897
- return Promise.resolve().then(function() {
1898
- var resultPromise;
1899
- if (typeof promiseFn === "function") {
1900
- resultPromise = promiseFn();
1901
- if (!checkIsPromise(resultPromise)) {
1902
- throw new ERR_INVALID_RETURN_VALUE("instance of Promise", "promiseFn", resultPromise);
1903
- }
1904
- } else if (checkIsPromise(promiseFn)) {
1905
- resultPromise = promiseFn;
1906
- } else {
1907
- throw new ERR_INVALID_ARG_TYPE("promiseFn", ["Function", "Promise"], promiseFn);
1908
- }
1909
- return Promise.resolve().then(function() {
1910
- return resultPromise;
1911
- }).then(function() {
1912
- return NO_EXCEPTION_SENTINEL;
1913
- }).catch(function(e) {
1914
- return e;
1915
- });
1916
- });
1917
- }
1918
- function expectsError(stackStartFn, actual, error, message) {
1919
- if (typeof error === "string") {
1920
- if (arguments.length === 4) {
1921
- throw new ERR_INVALID_ARG_TYPE("error", ["Object", "Error", "Function", "RegExp"], error);
1922
- }
1923
- if (_typeof(actual) === "object" && actual !== null) {
1924
- if (actual.message === error) {
1925
- throw new ERR_AMBIGUOUS_ARGUMENT("error/message", 'The error message "'.concat(actual.message, '" is identical to the message.'));
1926
- }
1927
- } else if (actual === error) {
1928
- throw new ERR_AMBIGUOUS_ARGUMENT("error/message", 'The error "'.concat(actual, '" is identical to the message.'));
1929
- }
1930
- message = error;
1931
- error = void 0;
1932
- } else if (error != null && _typeof(error) !== "object" && typeof error !== "function") {
1933
- throw new ERR_INVALID_ARG_TYPE("error", ["Object", "Error", "Function", "RegExp"], error);
1934
- }
1935
- if (actual === NO_EXCEPTION_SENTINEL) {
1936
- var details = "";
1937
- if (error && error.name) {
1938
- details += " (".concat(error.name, ")");
1939
- }
1940
- details += message ? ": ".concat(message) : ".";
1941
- var fnType = stackStartFn.name === "rejects" ? "rejection" : "exception";
1942
- innerFail({
1943
- actual: void 0,
1944
- expected: error,
1945
- operator: stackStartFn.name,
1946
- message: "Missing expected ".concat(fnType).concat(details),
1947
- stackStartFn
1948
- });
1949
- }
1950
- if (error && !expectedException(actual, error, message, stackStartFn)) {
1951
- throw actual;
1952
- }
1953
- }
1954
- function expectsNoError(stackStartFn, actual, error, message) {
1955
- if (actual === NO_EXCEPTION_SENTINEL) return;
1956
- if (typeof error === "string") {
1957
- message = error;
1958
- error = void 0;
1959
- }
1960
- if (!error || expectedException(actual, error)) {
1961
- var details = message ? ": ".concat(message) : ".";
1962
- var fnType = stackStartFn.name === "doesNotReject" ? "rejection" : "exception";
1963
- innerFail({
1964
- actual,
1965
- expected: error,
1966
- operator: stackStartFn.name,
1967
- message: "Got unwanted ".concat(fnType).concat(details, "\n") + 'Actual message: "'.concat(actual && actual.message, '"'),
1968
- stackStartFn
1969
- });
1970
- }
1971
- throw actual;
1972
- }
1973
- assert2.throws = function throws(promiseFn) {
1974
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
1975
- args[_key2 - 1] = arguments[_key2];
1976
- }
1977
- expectsError.apply(void 0, [throws, getActual(promiseFn)].concat(args));
1978
- };
1979
- assert2.rejects = function rejects(promiseFn) {
1980
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
1981
- args[_key3 - 1] = arguments[_key3];
1982
- }
1983
- return waitForActual(promiseFn).then(function(result) {
1984
- return expectsError.apply(void 0, [rejects, result].concat(args));
1985
- });
1986
- };
1987
- assert2.doesNotThrow = function doesNotThrow(fn) {
1988
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
1989
- args[_key4 - 1] = arguments[_key4];
1990
- }
1991
- expectsNoError.apply(void 0, [doesNotThrow, getActual(fn)].concat(args));
1992
- };
1993
- assert2.doesNotReject = function doesNotReject(fn) {
1994
- for (var _len5 = arguments.length, args = new Array(_len5 > 1 ? _len5 - 1 : 0), _key5 = 1; _key5 < _len5; _key5++) {
1995
- args[_key5 - 1] = arguments[_key5];
1996
- }
1997
- return waitForActual(fn).then(function(result) {
1998
- return expectsNoError.apply(void 0, [doesNotReject, result].concat(args));
1999
- });
2000
- };
2001
- assert2.ifError = function ifError(err) {
2002
- if (err !== null && err !== void 0) {
2003
- var message = "ifError got unwanted exception: ";
2004
- if (_typeof(err) === "object" && typeof err.message === "string") {
2005
- if (err.message.length === 0 && err.constructor) {
2006
- message += err.constructor.name;
2007
- } else {
2008
- message += err.message;
2009
- }
2010
- } else {
2011
- message += inspect(err);
2012
- }
2013
- var newErr = new AssertionError({
2014
- actual: err,
2015
- expected: null,
2016
- operator: "ifError",
2017
- message,
2018
- stackStartFn: ifError
2019
- });
2020
- var origStack = err.stack;
2021
- if (typeof origStack === "string") {
2022
- var tmp2 = origStack.split("\n");
2023
- tmp2.shift();
2024
- var tmp1 = newErr.stack.split("\n");
2025
- for (var i = 0; i < tmp2.length; i++) {
2026
- var pos = tmp1.indexOf(tmp2[i]);
2027
- if (pos !== -1) {
2028
- tmp1 = tmp1.slice(0, pos);
2029
- break;
2030
- }
2031
- }
2032
- newErr.stack = "".concat(tmp1.join("\n"), "\n").concat(tmp2.join("\n"));
2033
- }
2034
- throw newErr;
2035
- }
2036
- };
2037
- function strict() {
2038
- for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
2039
- args[_key6] = arguments[_key6];
2040
- }
2041
- innerOk.apply(void 0, [strict, args.length].concat(args));
2042
- }
2043
- assert2.strict = objectAssign(strict, assert2, {
2044
- equal: assert2.strictEqual,
2045
- deepEqual: assert2.deepStrictEqual,
2046
- notEqual: assert2.notStrictEqual,
2047
- notDeepEqual: assert2.notDeepStrictEqual
2048
- });
2049
- assert2.strict.strict = assert2.strict;
2050
- }
2051
- });
2052
-
2053
- // src/assert.js
2054
- var import_assert = __toESM(require_assert(), 1);
2055
- var assert_default = import_assert.default;
2056
- export {
2057
- assert_default as default
2058
- };
2059
- /*! Bundled license information:
2060
-
2061
- assert/build/internal/util/comparisons.js:
2062
- (*!
2063
- * The buffer module from node.js, for the browser.
2064
- *
2065
- * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2066
- * @license MIT
2067
- *)
2068
- */
2069
- //# sourceMappingURL=assert.mjs.map