@layerzerolabs/typescript-utils 0.2.6 → 0.2.8
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.
- package/.turbo/turbo-build.log +126 -124
- package/.turbo/turbo-lint.log +4 -0
- package/dist/{U7VZULNU.cjs → 24WEKBY3.cjs} +5 -12
- package/dist/24WEKBY3.cjs.map +1 -0
- package/dist/2MZ52QXI.cjs +8 -0
- package/dist/{M2FMGCRF.cjs.map → 2MZ52QXI.cjs.map} +1 -1
- package/dist/2OSBYVBM.cjs +8 -0
- package/dist/{Q74ZLWCL.cjs.map → 2OSBYVBM.cjs.map} +1 -1
- package/dist/2SJJDCZI.cjs +8 -0
- package/dist/{44IBECAR.cjs.map → 2SJJDCZI.cjs.map} +1 -1
- package/dist/4W25K7RR.cjs +8 -0
- package/dist/{VLOINXK2.cjs.map → 4W25K7RR.cjs.map} +1 -1
- package/dist/53OHF4EH.cjs +8 -0
- package/dist/{BPWNPHCG.cjs.map → 53OHF4EH.cjs.map} +1 -1
- package/dist/574X5FJM.cjs +8 -0
- package/dist/{HKAX3PXE.cjs.map → 574X5FJM.cjs.map} +1 -1
- package/dist/62TVLGZP.js +6 -0
- package/dist/{62A6WP5R.js.map → 62TVLGZP.js.map} +1 -1
- package/dist/{4RNWLMHM.js → 6AHA7PAZ.js} +8 -13
- package/dist/6AHA7PAZ.js.map +1 -0
- package/dist/6IUBP3YE.js +6 -0
- package/dist/{DXU6T5SS.js.map → 6IUBP3YE.js.map} +1 -1
- package/dist/{Q3ERQ4ME.cjs → 7BSTQVJO.cjs} +957 -884
- package/dist/7BSTQVJO.cjs.map +1 -0
- package/dist/7RPBI4LQ.cjs +8 -0
- package/dist/{5UH6HTHX.cjs.map → 7RPBI4LQ.cjs.map} +1 -1
- package/dist/AKBGASRF.cjs +8 -0
- package/dist/{Y53SFKBY.cjs.map → AKBGASRF.cjs.map} +1 -1
- package/dist/B5GSIBEU.js +6 -0
- package/dist/{7MFOZW3L.js.map → B5GSIBEU.js.map} +1 -1
- package/dist/C7GMKBCN.cjs +8 -0
- package/dist/{TOWGFQYX.cjs.map → C7GMKBCN.cjs.map} +1 -1
- package/dist/CFTTK4D6.js +6 -0
- package/dist/{TU2BPRNU.js.map → CFTTK4D6.js.map} +1 -1
- package/dist/{AYCOZKHR.js → CI7BVOAG.js} +539 -466
- package/dist/CI7BVOAG.js.map +1 -0
- package/dist/DDDCRYAA.js +6 -0
- package/dist/{HVKBLL5V.js.map → DDDCRYAA.js.map} +1 -1
- package/dist/EFBUJ7T4.cjs +8 -0
- package/dist/{GKC44C4P.cjs.map → EFBUJ7T4.cjs.map} +1 -1
- package/dist/ENRZFLLD.js +6 -0
- package/dist/{GHCFU27L.js.map → ENRZFLLD.js.map} +1 -1
- package/dist/{AMF2EES3.cjs → EUBM3LSR.cjs} +42 -27
- package/dist/EUBM3LSR.cjs.map +1 -0
- package/dist/FQ2L5NQU.js +6 -0
- package/dist/{TML6PHUW.js.map → FQ2L5NQU.js.map} +1 -1
- package/dist/{XM743A75.js → GGKJNPTT.js} +22 -7
- package/dist/GGKJNPTT.js.map +1 -0
- package/dist/I5NXBMAF.js +6 -0
- package/dist/{FPWOFXCL.js.map → I5NXBMAF.js.map} +1 -1
- package/dist/K3FZ3EZT.cjs +8 -0
- package/dist/{KLHW5WN3.cjs.map → K3FZ3EZT.cjs.map} +1 -1
- package/dist/KEJFF7VD.js +6 -0
- package/dist/{C2AO2CD6.js.map → KEJFF7VD.js.map} +1 -1
- package/dist/KZQATXOW.js +6 -0
- package/dist/{TDMZOP4J.js.map → KZQATXOW.js.map} +1 -1
- package/dist/MLSONTXK.cjs +8 -0
- package/dist/{B77ZZJ5J.cjs.map → MLSONTXK.cjs.map} +1 -1
- package/dist/NKWLAYNJ.cjs +8 -0
- package/dist/{FQTDMGIM.cjs.map → NKWLAYNJ.cjs.map} +1 -1
- package/dist/P3JODCMF.js +6 -0
- package/dist/{MNZ3MKHF.js.map → P3JODCMF.js.map} +1 -1
- package/dist/Q35ZNXMT.cjs +8 -0
- package/dist/{JRGCWPQC.cjs.map → Q35ZNXMT.cjs.map} +1 -1
- package/dist/Q6UBIYTZ.js +6 -0
- package/dist/{FSZMZLCN.js.map → Q6UBIYTZ.js.map} +1 -1
- package/dist/TQNP6GIE.js +6 -0
- package/dist/{ZPWIEOJR.js.map → TQNP6GIE.js.map} +1 -1
- package/dist/TVCGTTL5.cjs +8 -0
- package/dist/{ZLF3Y44J.cjs.map → TVCGTTL5.cjs.map} +1 -1
- package/dist/V353KAGF.js +6 -0
- package/dist/{N3MJTAM7.js.map → V353KAGF.js.map} +1 -1
- package/dist/X6GYSLZB.js +6 -0
- package/dist/{3OBHE7MG.js.map → X6GYSLZB.js.map} +1 -1
- package/dist/ZDGUYQPS.cjs +8 -0
- package/dist/{ATSF4XM5.cjs.map → ZDGUYQPS.cjs.map} +1 -1
- package/dist/ZS6LQCLY.js +6 -0
- package/dist/{BLALMGVL.js.map → ZS6LQCLY.js.map} +1 -1
- package/dist/advancedRecord.cjs +2 -2
- package/dist/advancedRecord.js +2 -2
- package/dist/branded.cjs +2 -2
- package/dist/branded.js +2 -2
- package/dist/constructor.cjs +2 -2
- package/dist/constructor.js +2 -2
- package/dist/deep.cjs +2 -2
- package/dist/deep.js +2 -2
- package/dist/deep.test-d.cjs +8 -8
- package/dist/deep.test-d.cjs.map +1 -1
- package/dist/deep.test-d.js +2 -2
- package/dist/disallowedAny.cjs +2 -2
- package/dist/disallowedAny.js +2 -2
- package/dist/identity.cjs +2 -2
- package/dist/identity.js +2 -2
- package/dist/index.cjs +18 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -17
- package/dist/lastOf.cjs +2 -2
- package/dist/lastOf.js +2 -2
- package/dist/maybeUndefined.cjs +2 -2
- package/dist/maybeUndefined.js +2 -2
- package/dist/merge.cjs +2 -2
- package/dist/merge.js +2 -2
- package/dist/methodOf.cjs +2 -2
- package/dist/methodOf.js +2 -2
- package/dist/removeNever.cjs +2 -2
- package/dist/removeNever.js +2 -2
- package/dist/strings.cjs +2 -2
- package/dist/strings.js +2 -2
- package/dist/strings.test-d.cjs +13 -13
- package/dist/strings.test-d.cjs.map +1 -1
- package/dist/strings.test-d.js +2 -2
- package/dist/tuples.cjs +2 -2
- package/dist/tuples.js +2 -2
- package/dist/valueOf.cjs +2 -2
- package/dist/valueOf.js +2 -2
- package/dist/viem.cjs +2 -2
- package/dist/viem.js +2 -2
- package/dist/withRequired.cjs +2 -2
- package/dist/withRequired.js +2 -2
- package/package.json +3 -4
- package/dist/3OBHE7MG.js +0 -6
- package/dist/44IBECAR.cjs +0 -8
- package/dist/4RNWLMHM.js.map +0 -1
- package/dist/5UH6HTHX.cjs +0 -8
- package/dist/62A6WP5R.js +0 -6
- package/dist/7MFOZW3L.js +0 -6
- package/dist/AMF2EES3.cjs.map +0 -1
- package/dist/ATSF4XM5.cjs +0 -8
- package/dist/AYCOZKHR.js.map +0 -1
- package/dist/B77ZZJ5J.cjs +0 -8
- package/dist/BLALMGVL.js +0 -6
- package/dist/BPWNPHCG.cjs +0 -8
- package/dist/C2AO2CD6.js +0 -6
- package/dist/DXU6T5SS.js +0 -6
- package/dist/FPWOFXCL.js +0 -6
- package/dist/FQTDMGIM.cjs +0 -8
- package/dist/FSZMZLCN.js +0 -6
- package/dist/GHCFU27L.js +0 -6
- package/dist/GKC44C4P.cjs +0 -8
- package/dist/HKAX3PXE.cjs +0 -8
- package/dist/HVKBLL5V.js +0 -6
- package/dist/JRGCWPQC.cjs +0 -8
- package/dist/KLHW5WN3.cjs +0 -8
- package/dist/M2FMGCRF.cjs +0 -8
- package/dist/MNZ3MKHF.js +0 -6
- package/dist/N3MJTAM7.js +0 -6
- package/dist/Q3ERQ4ME.cjs.map +0 -1
- package/dist/Q74ZLWCL.cjs +0 -8
- package/dist/TDMZOP4J.js +0 -6
- package/dist/TML6PHUW.js +0 -6
- package/dist/TOWGFQYX.cjs +0 -8
- package/dist/TU2BPRNU.js +0 -6
- package/dist/U7VZULNU.cjs.map +0 -1
- package/dist/VLOINXK2.cjs +0 -8
- package/dist/XM743A75.js.map +0 -1
- package/dist/Y53SFKBY.cjs +0 -8
- package/dist/ZLF3Y44J.cjs +0 -8
- package/dist/ZPWIEOJR.js +0 -6
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { __commonJS, init_esm_shims, __name,
|
|
1
|
+
import { __commonJS, init_esm_shims, __name, __toESM } from './6AHA7PAZ.js';
|
|
2
2
|
import { isatty } from 'tty';
|
|
3
3
|
|
|
4
4
|
// ../../node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js
|
|
5
5
|
var require_js_tokens = __commonJS({
|
|
6
|
-
"../../node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js"(exports, module) {
|
|
6
|
+
"../../node_modules/.pnpm/js-tokens@9.0.1/node_modules/js-tokens/index.js"(exports$1, module) {
|
|
7
7
|
init_esm_shims();
|
|
8
8
|
var HashbangComment;
|
|
9
9
|
var Identifier;
|
|
@@ -433,51 +433,51 @@ var require_js_tokens = __commonJS({
|
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
|
|
436
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
436
|
+
// ../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js
|
|
437
437
|
var require_branding = __commonJS({
|
|
438
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
438
|
+
"../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/branding.js"(exports$1) {
|
|
439
439
|
init_esm_shims();
|
|
440
|
-
Object.defineProperty(exports, "__esModule", {
|
|
440
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
441
441
|
value: true
|
|
442
442
|
});
|
|
443
443
|
}
|
|
444
444
|
});
|
|
445
445
|
|
|
446
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
446
|
+
// ../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js
|
|
447
447
|
var require_messages = __commonJS({
|
|
448
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
448
|
+
"../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/messages.js"(exports$1) {
|
|
449
449
|
init_esm_shims();
|
|
450
|
-
Object.defineProperty(exports, "__esModule", {
|
|
450
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
451
451
|
value: true
|
|
452
452
|
});
|
|
453
453
|
}
|
|
454
454
|
});
|
|
455
455
|
|
|
456
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
456
|
+
// ../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js
|
|
457
457
|
var require_overloads = __commonJS({
|
|
458
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
458
|
+
"../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/overloads.js"(exports$1) {
|
|
459
459
|
init_esm_shims();
|
|
460
|
-
Object.defineProperty(exports, "__esModule", {
|
|
460
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
461
461
|
value: true
|
|
462
462
|
});
|
|
463
463
|
}
|
|
464
464
|
});
|
|
465
465
|
|
|
466
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
466
|
+
// ../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js
|
|
467
467
|
var require_utils = __commonJS({
|
|
468
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
468
|
+
"../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/utils.js"(exports$1) {
|
|
469
469
|
init_esm_shims();
|
|
470
|
-
Object.defineProperty(exports, "__esModule", {
|
|
470
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
471
471
|
value: true
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
474
|
});
|
|
475
475
|
|
|
476
|
-
// ../../node_modules/.pnpm/expect-type@1.2.
|
|
476
|
+
// ../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js
|
|
477
477
|
var require_dist = __commonJS({
|
|
478
|
-
"../../node_modules/.pnpm/expect-type@1.2.
|
|
478
|
+
"../../node_modules/.pnpm/expect-type@1.2.2/node_modules/expect-type/dist/index.js"(exports$1) {
|
|
479
479
|
init_esm_shims();
|
|
480
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? function(o, m2, k, k2) {
|
|
480
|
+
var __createBinding = exports$1 && exports$1.__createBinding || (Object.create ? function(o, m2, k, k2) {
|
|
481
481
|
if (k2 === void 0) k2 = k;
|
|
482
482
|
var desc = Object.getOwnPropertyDescriptor(m2, k);
|
|
483
483
|
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
@@ -493,17 +493,17 @@ var require_dist = __commonJS({
|
|
|
493
493
|
if (k2 === void 0) k2 = k;
|
|
494
494
|
o[k2] = m2[k];
|
|
495
495
|
});
|
|
496
|
-
var __exportStar = exports && exports.__exportStar || function(m2, exports1) {
|
|
496
|
+
var __exportStar = exports$1 && exports$1.__exportStar || function(m2, exports1) {
|
|
497
497
|
for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports1, p2)) __createBinding(exports1, m2, p2);
|
|
498
498
|
};
|
|
499
|
-
Object.defineProperty(exports, "__esModule", {
|
|
499
|
+
Object.defineProperty(exports$1, "__esModule", {
|
|
500
500
|
value: true
|
|
501
501
|
});
|
|
502
|
-
exports.expectTypeOf = void 0;
|
|
503
|
-
__exportStar(require_branding(), exports);
|
|
504
|
-
__exportStar(require_messages(), exports);
|
|
505
|
-
__exportStar(require_overloads(), exports);
|
|
506
|
-
__exportStar(require_utils(), exports);
|
|
502
|
+
exports$1.expectTypeOf = void 0;
|
|
503
|
+
__exportStar(require_branding(), exports$1);
|
|
504
|
+
__exportStar(require_messages(), exports$1);
|
|
505
|
+
__exportStar(require_overloads(), exports$1);
|
|
506
|
+
__exportStar(require_utils(), exports$1);
|
|
507
507
|
var fn = /* @__PURE__ */ __name(() => true, "fn");
|
|
508
508
|
var expectTypeOf2 = /* @__PURE__ */ __name((_actual) => {
|
|
509
509
|
const nonFunctionProperties = [
|
|
@@ -541,35 +541,35 @@ var require_dist = __commonJS({
|
|
|
541
541
|
toBeConstructibleWith: fn,
|
|
542
542
|
toMatchObjectType: fn,
|
|
543
543
|
toExtend: fn,
|
|
544
|
-
map: exports.expectTypeOf,
|
|
545
|
-
toBeCallableWith: exports.expectTypeOf,
|
|
546
|
-
extract: exports.expectTypeOf,
|
|
547
|
-
exclude: exports.expectTypeOf,
|
|
548
|
-
pick: exports.expectTypeOf,
|
|
549
|
-
omit: exports.expectTypeOf,
|
|
550
|
-
toHaveProperty: exports.expectTypeOf,
|
|
551
|
-
parameter: exports.expectTypeOf
|
|
544
|
+
map: exports$1.expectTypeOf,
|
|
545
|
+
toBeCallableWith: exports$1.expectTypeOf,
|
|
546
|
+
extract: exports$1.expectTypeOf,
|
|
547
|
+
exclude: exports$1.expectTypeOf,
|
|
548
|
+
pick: exports$1.expectTypeOf,
|
|
549
|
+
omit: exports$1.expectTypeOf,
|
|
550
|
+
toHaveProperty: exports$1.expectTypeOf,
|
|
551
|
+
parameter: exports$1.expectTypeOf
|
|
552
552
|
};
|
|
553
553
|
const getterProperties = nonFunctionProperties;
|
|
554
554
|
getterProperties.forEach((prop) => Object.defineProperty(obj, prop, {
|
|
555
|
-
get: /* @__PURE__ */ __name(() => (0, exports.expectTypeOf)({}), "get")
|
|
555
|
+
get: /* @__PURE__ */ __name(() => (0, exports$1.expectTypeOf)({}), "get")
|
|
556
556
|
}));
|
|
557
557
|
return obj;
|
|
558
558
|
}, "expectTypeOf");
|
|
559
|
-
exports.expectTypeOf = expectTypeOf2;
|
|
559
|
+
exports$1.expectTypeOf = expectTypeOf2;
|
|
560
560
|
}
|
|
561
561
|
});
|
|
562
562
|
|
|
563
|
-
// ../../node_modules/.pnpm/@vitest+runner@3.2.
|
|
563
|
+
// ../../node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js
|
|
564
564
|
init_esm_shims();
|
|
565
565
|
|
|
566
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.2.
|
|
566
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/index.js
|
|
567
567
|
init_esm_shims();
|
|
568
568
|
|
|
569
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.2.
|
|
569
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
|
|
570
570
|
init_esm_shims();
|
|
571
571
|
|
|
572
|
-
// ../../node_modules/.pnpm/@vitest+pretty-format@3.2.
|
|
572
|
+
// ../../node_modules/.pnpm/@vitest+pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js
|
|
573
573
|
init_esm_shims();
|
|
574
574
|
|
|
575
575
|
// ../../node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/node.js
|
|
@@ -780,8 +780,8 @@ __name(p, "p");
|
|
|
780
780
|
var r = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
781
781
|
p(r);
|
|
782
782
|
|
|
783
|
-
// ../../node_modules/.pnpm/@vitest+pretty-format@3.2.
|
|
784
|
-
function _mergeNamespaces(n, m2) {
|
|
783
|
+
// ../../node_modules/.pnpm/@vitest+pretty-format@3.2.4/node_modules/@vitest/pretty-format/dist/index.js
|
|
784
|
+
function _mergeNamespaces$1(n, m2) {
|
|
785
785
|
m2.forEach(function(e) {
|
|
786
786
|
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
787
787
|
if (k !== "default" && !(k in n)) {
|
|
@@ -797,7 +797,7 @@ function _mergeNamespaces(n, m2) {
|
|
|
797
797
|
});
|
|
798
798
|
return Object.freeze(n);
|
|
799
799
|
}
|
|
800
|
-
__name(_mergeNamespaces, "_mergeNamespaces");
|
|
800
|
+
__name(_mergeNamespaces$1, "_mergeNamespaces");
|
|
801
801
|
function getKeysOfEnumerableProperties(object, compareKeys) {
|
|
802
802
|
const rawKeys = Object.keys(object);
|
|
803
803
|
const keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
|
|
@@ -1266,7 +1266,7 @@ function requireReactIs$1() {
|
|
|
1266
1266
|
__name(requireReactIs$1, "requireReactIs$1");
|
|
1267
1267
|
var reactIsExports$1 = requireReactIs$1();
|
|
1268
1268
|
var index$1 = /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports$1);
|
|
1269
|
-
var ReactIs19 = /* @__PURE__ */ _mergeNamespaces({
|
|
1269
|
+
var ReactIs19 = /* @__PURE__ */ _mergeNamespaces$1({
|
|
1270
1270
|
__proto__: null,
|
|
1271
1271
|
default: index$1
|
|
1272
1272
|
}, [
|
|
@@ -1586,7 +1586,7 @@ function requireReactIs() {
|
|
|
1586
1586
|
__name(requireReactIs, "requireReactIs");
|
|
1587
1587
|
var reactIsExports = requireReactIs();
|
|
1588
1588
|
var index = /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports);
|
|
1589
|
-
var ReactIs18 = /* @__PURE__ */ _mergeNamespaces({
|
|
1589
|
+
var ReactIs18 = /* @__PURE__ */ _mergeNamespaces$1({
|
|
1590
1590
|
__proto__: null,
|
|
1591
1591
|
default: index
|
|
1592
1592
|
}, [
|
|
@@ -1675,13 +1675,13 @@ function getConstructorName(val) {
|
|
|
1675
1675
|
}
|
|
1676
1676
|
__name(getConstructorName, "getConstructorName");
|
|
1677
1677
|
|
|
1678
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1678
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js
|
|
1679
1679
|
init_esm_shims();
|
|
1680
1680
|
|
|
1681
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1681
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js
|
|
1682
1682
|
init_esm_shims();
|
|
1683
1683
|
|
|
1684
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1684
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/helpers.js
|
|
1685
1685
|
init_esm_shims();
|
|
1686
1686
|
var ansiColors = {
|
|
1687
1687
|
bold: [
|
|
@@ -1915,7 +1915,7 @@ function inspectProperty([key, value], options) {
|
|
|
1915
1915
|
}
|
|
1916
1916
|
__name(inspectProperty, "inspectProperty");
|
|
1917
1917
|
|
|
1918
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1918
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/array.js
|
|
1919
1919
|
function inspectArray(array, options) {
|
|
1920
1920
|
const nonIndexProperties = Object.keys(array).slice(array.length);
|
|
1921
1921
|
if (!array.length && !nonIndexProperties.length) return "[]";
|
|
@@ -1933,7 +1933,7 @@ function inspectArray(array, options) {
|
|
|
1933
1933
|
}
|
|
1934
1934
|
__name(inspectArray, "inspectArray");
|
|
1935
1935
|
|
|
1936
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1936
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/typedarray.js
|
|
1937
1937
|
init_esm_shims();
|
|
1938
1938
|
var getArrayName = /* @__PURE__ */ __name((array) => {
|
|
1939
1939
|
if (typeof Buffer === "function" && array instanceof Buffer) {
|
|
@@ -1970,7 +1970,7 @@ function inspectTypedArray(array, options) {
|
|
|
1970
1970
|
}
|
|
1971
1971
|
__name(inspectTypedArray, "inspectTypedArray");
|
|
1972
1972
|
|
|
1973
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1973
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/date.js
|
|
1974
1974
|
init_esm_shims();
|
|
1975
1975
|
function inspectDate(dateObject, options) {
|
|
1976
1976
|
const stringRepresentation = dateObject.toJSON();
|
|
@@ -1983,7 +1983,7 @@ function inspectDate(dateObject, options) {
|
|
|
1983
1983
|
}
|
|
1984
1984
|
__name(inspectDate, "inspectDate");
|
|
1985
1985
|
|
|
1986
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1986
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/function.js
|
|
1987
1987
|
init_esm_shims();
|
|
1988
1988
|
function inspectFunction(func, options) {
|
|
1989
1989
|
const functionType = func[Symbol.toStringTag] || "Function";
|
|
@@ -1995,7 +1995,7 @@ function inspectFunction(func, options) {
|
|
|
1995
1995
|
}
|
|
1996
1996
|
__name(inspectFunction, "inspectFunction");
|
|
1997
1997
|
|
|
1998
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
1998
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/map.js
|
|
1999
1999
|
init_esm_shims();
|
|
2000
2000
|
function inspectMapEntry([key, value], options) {
|
|
2001
2001
|
options.truncate -= 4;
|
|
@@ -2023,7 +2023,7 @@ function inspectMap(map, options) {
|
|
|
2023
2023
|
}
|
|
2024
2024
|
__name(inspectMap, "inspectMap");
|
|
2025
2025
|
|
|
2026
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2026
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/number.js
|
|
2027
2027
|
init_esm_shims();
|
|
2028
2028
|
var isNaN = Number.isNaN || ((i) => i !== i);
|
|
2029
2029
|
function inspectNumber(number, options) {
|
|
@@ -2043,7 +2043,7 @@ function inspectNumber(number, options) {
|
|
|
2043
2043
|
}
|
|
2044
2044
|
__name(inspectNumber, "inspectNumber");
|
|
2045
2045
|
|
|
2046
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2046
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/bigint.js
|
|
2047
2047
|
init_esm_shims();
|
|
2048
2048
|
function inspectBigInt(number, options) {
|
|
2049
2049
|
let nums = truncate(number.toString(), options.truncate - 1);
|
|
@@ -2052,7 +2052,7 @@ function inspectBigInt(number, options) {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
__name(inspectBigInt, "inspectBigInt");
|
|
2054
2054
|
|
|
2055
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2055
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/regexp.js
|
|
2056
2056
|
init_esm_shims();
|
|
2057
2057
|
function inspectRegExp(value, options) {
|
|
2058
2058
|
const flags = value.toString().split("/")[2];
|
|
@@ -2062,7 +2062,7 @@ function inspectRegExp(value, options) {
|
|
|
2062
2062
|
}
|
|
2063
2063
|
__name(inspectRegExp, "inspectRegExp");
|
|
2064
2064
|
|
|
2065
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2065
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/set.js
|
|
2066
2066
|
init_esm_shims();
|
|
2067
2067
|
function arrayFromSet(set2) {
|
|
2068
2068
|
const values = [];
|
|
@@ -2079,7 +2079,7 @@ function inspectSet(set2, options) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
__name(inspectSet, "inspectSet");
|
|
2081
2081
|
|
|
2082
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2082
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/string.js
|
|
2083
2083
|
init_esm_shims();
|
|
2084
2084
|
var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g");
|
|
2085
2085
|
var escapeCharacters = {
|
|
@@ -2104,7 +2104,7 @@ function inspectString(string, options) {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
__name(inspectString, "inspectString");
|
|
2106
2106
|
|
|
2107
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2107
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/symbol.js
|
|
2108
2108
|
init_esm_shims();
|
|
2109
2109
|
function inspectSymbol(value) {
|
|
2110
2110
|
if ("description" in Symbol.prototype) {
|
|
@@ -2114,28 +2114,15 @@ function inspectSymbol(value) {
|
|
|
2114
2114
|
}
|
|
2115
2115
|
__name(inspectSymbol, "inspectSymbol");
|
|
2116
2116
|
|
|
2117
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2117
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/promise.js
|
|
2118
2118
|
init_esm_shims();
|
|
2119
2119
|
var getPromiseValue = /* @__PURE__ */ __name(() => "Promise{\u2026}", "getPromiseValue");
|
|
2120
|
-
try {
|
|
2121
|
-
const { getPromiseDetails, kPending, kRejected } = process.binding("util");
|
|
2122
|
-
if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
|
|
2123
|
-
getPromiseValue = /* @__PURE__ */ __name((value, options) => {
|
|
2124
|
-
const [state, innerValue] = getPromiseDetails(value);
|
|
2125
|
-
if (state === kPending) {
|
|
2126
|
-
return "Promise{<pending>}";
|
|
2127
|
-
}
|
|
2128
|
-
return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
|
|
2129
|
-
}, "getPromiseValue");
|
|
2130
|
-
}
|
|
2131
|
-
} catch (notNode) {
|
|
2132
|
-
}
|
|
2133
2120
|
var promise_default = getPromiseValue;
|
|
2134
2121
|
|
|
2135
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2122
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js
|
|
2136
2123
|
init_esm_shims();
|
|
2137
2124
|
|
|
2138
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2125
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/object.js
|
|
2139
2126
|
init_esm_shims();
|
|
2140
2127
|
function inspectObject(object, options) {
|
|
2141
2128
|
const properties = Object.getOwnPropertyNames(object);
|
|
@@ -2166,7 +2153,7 @@ function inspectObject(object, options) {
|
|
|
2166
2153
|
}
|
|
2167
2154
|
__name(inspectObject, "inspectObject");
|
|
2168
2155
|
|
|
2169
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2156
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/class.js
|
|
2170
2157
|
var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false;
|
|
2171
2158
|
function inspectClass(value, options) {
|
|
2172
2159
|
let name = "";
|
|
@@ -2182,7 +2169,7 @@ function inspectClass(value, options) {
|
|
|
2182
2169
|
}
|
|
2183
2170
|
__name(inspectClass, "inspectClass");
|
|
2184
2171
|
|
|
2185
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2172
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/arguments.js
|
|
2186
2173
|
init_esm_shims();
|
|
2187
2174
|
function inspectArguments(args, options) {
|
|
2188
2175
|
if (args.length === 0) return "Arguments[]";
|
|
@@ -2191,7 +2178,7 @@ function inspectArguments(args, options) {
|
|
|
2191
2178
|
}
|
|
2192
2179
|
__name(inspectArguments, "inspectArguments");
|
|
2193
2180
|
|
|
2194
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2181
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/error.js
|
|
2195
2182
|
init_esm_shims();
|
|
2196
2183
|
var errorKeys = [
|
|
2197
2184
|
"stack",
|
|
@@ -2231,7 +2218,7 @@ function inspectObject2(error, options) {
|
|
|
2231
2218
|
}
|
|
2232
2219
|
__name(inspectObject2, "inspectObject");
|
|
2233
2220
|
|
|
2234
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2221
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/html.js
|
|
2235
2222
|
init_esm_shims();
|
|
2236
2223
|
function inspectAttribute([key, value], options) {
|
|
2237
2224
|
options.truncate -= 3;
|
|
@@ -2241,10 +2228,21 @@ function inspectAttribute([key, value], options) {
|
|
|
2241
2228
|
return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`;
|
|
2242
2229
|
}
|
|
2243
2230
|
__name(inspectAttribute, "inspectAttribute");
|
|
2244
|
-
function
|
|
2245
|
-
return inspectList(collection, options,
|
|
2231
|
+
function inspectNodeCollection(collection, options) {
|
|
2232
|
+
return inspectList(collection, options, inspectNode, "\n");
|
|
2233
|
+
}
|
|
2234
|
+
__name(inspectNodeCollection, "inspectNodeCollection");
|
|
2235
|
+
function inspectNode(node, options) {
|
|
2236
|
+
switch (node.nodeType) {
|
|
2237
|
+
case 1:
|
|
2238
|
+
return inspectHTML(node, options);
|
|
2239
|
+
case 3:
|
|
2240
|
+
return options.inspect(node.data, options);
|
|
2241
|
+
default:
|
|
2242
|
+
return options.inspect(node, options);
|
|
2243
|
+
}
|
|
2246
2244
|
}
|
|
2247
|
-
__name(
|
|
2245
|
+
__name(inspectNode, "inspectNode");
|
|
2248
2246
|
function inspectHTML(element, options) {
|
|
2249
2247
|
const properties = element.getAttributeNames();
|
|
2250
2248
|
const name = element.tagName.toLowerCase();
|
|
@@ -2262,7 +2260,7 @@ function inspectHTML(element, options) {
|
|
|
2262
2260
|
}
|
|
2263
2261
|
options.truncate -= propertyContents.length;
|
|
2264
2262
|
const truncate3 = options.truncate;
|
|
2265
|
-
let children =
|
|
2263
|
+
let children = inspectNodeCollection(element.children, options);
|
|
2266
2264
|
if (children && children.length > truncate3) {
|
|
2267
2265
|
children = `${truncator}(${element.children.length})`;
|
|
2268
2266
|
}
|
|
@@ -2270,16 +2268,10 @@ function inspectHTML(element, options) {
|
|
|
2270
2268
|
}
|
|
2271
2269
|
__name(inspectHTML, "inspectHTML");
|
|
2272
2270
|
|
|
2273
|
-
// ../../node_modules/.pnpm/loupe@3.1
|
|
2271
|
+
// ../../node_modules/.pnpm/loupe@3.2.1/node_modules/loupe/lib/index.js
|
|
2274
2272
|
var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function";
|
|
2275
2273
|
var chaiInspect = symbolsSupported ? Symbol.for("chai/inspect") : "@@chai/inspect";
|
|
2276
|
-
var nodeInspect =
|
|
2277
|
-
try {
|
|
2278
|
-
const nodeUtil = __require("util");
|
|
2279
|
-
nodeInspect = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
|
|
2280
|
-
} catch (noNodeInspect) {
|
|
2281
|
-
nodeInspect = false;
|
|
2282
|
-
}
|
|
2274
|
+
var nodeInspect = Symbol.for("nodejs.util.inspect.custom");
|
|
2283
2275
|
var constructorMap = /* @__PURE__ */ new WeakMap();
|
|
2284
2276
|
var stringTagMap = {};
|
|
2285
2277
|
var baseTypesMap = {
|
|
@@ -2321,15 +2313,15 @@ var baseTypesMap = {
|
|
|
2321
2313
|
DataView: /* @__PURE__ */ __name(() => "", "DataView"),
|
|
2322
2314
|
ArrayBuffer: /* @__PURE__ */ __name(() => "", "ArrayBuffer"),
|
|
2323
2315
|
Error: inspectObject2,
|
|
2324
|
-
HTMLCollection:
|
|
2325
|
-
NodeList:
|
|
2316
|
+
HTMLCollection: inspectNodeCollection,
|
|
2317
|
+
NodeList: inspectNodeCollection
|
|
2326
2318
|
};
|
|
2327
|
-
var inspectCustom = /* @__PURE__ */ __name((value, options, type3) => {
|
|
2319
|
+
var inspectCustom = /* @__PURE__ */ __name((value, options, type3, inspectFn) => {
|
|
2328
2320
|
if (chaiInspect in value && typeof value[chaiInspect] === "function") {
|
|
2329
2321
|
return value[chaiInspect](options);
|
|
2330
2322
|
}
|
|
2331
|
-
if (nodeInspect
|
|
2332
|
-
return value[nodeInspect](options.depth, options);
|
|
2323
|
+
if (nodeInspect in value && typeof value[nodeInspect] === "function") {
|
|
2324
|
+
return value[nodeInspect](options.depth, options, inspectFn);
|
|
2333
2325
|
}
|
|
2334
2326
|
if ("inspect" in value && typeof value.inspect === "function") {
|
|
2335
2327
|
return value.inspect(options.depth, options);
|
|
@@ -2354,7 +2346,7 @@ function inspect(value, opts = {}) {
|
|
|
2354
2346
|
return baseTypesMap[type3](value, options);
|
|
2355
2347
|
}
|
|
2356
2348
|
if (customInspect && value) {
|
|
2357
|
-
const output = inspectCustom(value, options, type3);
|
|
2349
|
+
const output = inspectCustom(value, options, type3, inspect);
|
|
2358
2350
|
if (output) {
|
|
2359
2351
|
if (typeof output === "string") return output;
|
|
2360
2352
|
return inspect(output, options);
|
|
@@ -2503,7 +2495,7 @@ function objDisplay(obj, options = {}) {
|
|
|
2503
2495
|
}
|
|
2504
2496
|
__name(objDisplay, "objDisplay");
|
|
2505
2497
|
|
|
2506
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.2.
|
|
2498
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/helpers.js
|
|
2507
2499
|
init_esm_shims();
|
|
2508
2500
|
function assertTypes(value, name, types) {
|
|
2509
2501
|
const receivedType = typeof value;
|
|
@@ -2565,7 +2557,7 @@ function isNegativeNaN(val) {
|
|
|
2565
2557
|
}
|
|
2566
2558
|
__name(isNegativeNaN, "isNegativeNaN");
|
|
2567
2559
|
|
|
2568
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.2.
|
|
2560
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/index.js
|
|
2569
2561
|
var jsTokens_1;
|
|
2570
2562
|
var hasRequiredJsTokens;
|
|
2571
2563
|
function requireJsTokens() {
|
|
@@ -3044,7 +3036,7 @@ function getSafeTimers() {
|
|
|
3044
3036
|
}
|
|
3045
3037
|
__name(getSafeTimers, "getSafeTimers");
|
|
3046
3038
|
|
|
3047
|
-
// ../../node_modules/.pnpm/@vitest+utils@3.2.
|
|
3039
|
+
// ../../node_modules/.pnpm/@vitest+utils@3.2.4/node_modules/@vitest/utils/dist/source-map.js
|
|
3048
3040
|
init_esm_shims();
|
|
3049
3041
|
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3050
3042
|
var intToChar = new Uint8Array(64);
|
|
@@ -3271,89 +3263,77 @@ function parseSingleV8Stack(raw) {
|
|
|
3271
3263
|
}
|
|
3272
3264
|
__name(parseSingleV8Stack, "parseSingleV8Stack");
|
|
3273
3265
|
|
|
3274
|
-
// ../../node_modules/.pnpm/strip-literal@3.
|
|
3266
|
+
// ../../node_modules/.pnpm/strip-literal@3.1.0/node_modules/strip-literal/dist/index.mjs
|
|
3275
3267
|
init_esm_shims();
|
|
3276
3268
|
var import_js_tokens = __toESM(require_js_tokens(), 1);
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
}
|
|
3289
|
-
if (token.type === "MultiLineComment") {
|
|
3290
|
-
result += token.value.replace(/[^\n]/g, FILL_COMMENT);
|
|
3291
|
-
continue;
|
|
3269
|
+
var FILL_COMMENT = " ";
|
|
3270
|
+
function stripLiteralFromToken(token, fillChar, filter) {
|
|
3271
|
+
if (token.type === "SingleLineComment") {
|
|
3272
|
+
return FILL_COMMENT.repeat(token.value.length);
|
|
3273
|
+
}
|
|
3274
|
+
if (token.type === "MultiLineComment") {
|
|
3275
|
+
return token.value.replace(/[^\n]/g, FILL_COMMENT);
|
|
3276
|
+
}
|
|
3277
|
+
if (token.type === "StringLiteral") {
|
|
3278
|
+
if (!token.closed) {
|
|
3279
|
+
return token.value;
|
|
3292
3280
|
}
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
continue;
|
|
3297
|
-
}
|
|
3298
|
-
const body = token.value.slice(1, -1);
|
|
3299
|
-
if (filter(body)) {
|
|
3300
|
-
result += token.value[0] + FILL.repeat(body.length) + token.value[token.value.length - 1];
|
|
3301
|
-
continue;
|
|
3302
|
-
}
|
|
3281
|
+
const body = token.value.slice(1, -1);
|
|
3282
|
+
if (filter(body)) {
|
|
3283
|
+
return token.value[0] + fillChar.repeat(body.length) + token.value[token.value.length - 1];
|
|
3303
3284
|
}
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
}
|
|
3285
|
+
}
|
|
3286
|
+
if (token.type === "NoSubstitutionTemplate") {
|
|
3287
|
+
const body = token.value.slice(1, -1);
|
|
3288
|
+
if (filter(body)) {
|
|
3289
|
+
return `\`${body.replace(/[^\n]/g, fillChar)}\``;
|
|
3310
3290
|
}
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
}
|
|
3291
|
+
}
|
|
3292
|
+
if (token.type === "RegularExpressionLiteral") {
|
|
3293
|
+
const body = token.value;
|
|
3294
|
+
if (filter(body)) {
|
|
3295
|
+
return body.replace(/\/(.*)\/(\w?)$/g, (_, $1, $2) => `/${fillChar.repeat($1.length)}/${$2}`);
|
|
3317
3296
|
}
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
}
|
|
3297
|
+
}
|
|
3298
|
+
if (token.type === "TemplateHead") {
|
|
3299
|
+
const body = token.value.slice(1, -2);
|
|
3300
|
+
if (filter(body)) {
|
|
3301
|
+
return `\`${body.replace(/[^\n]/g, fillChar)}\${`;
|
|
3324
3302
|
}
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
}
|
|
3303
|
+
}
|
|
3304
|
+
if (token.type === "TemplateTail") {
|
|
3305
|
+
const body = token.value.slice(0, -2);
|
|
3306
|
+
if (filter(body)) {
|
|
3307
|
+
return `}${body.replace(/[^\n]/g, fillChar)}\``;
|
|
3331
3308
|
}
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
}
|
|
3309
|
+
}
|
|
3310
|
+
if (token.type === "TemplateMiddle") {
|
|
3311
|
+
const body = token.value.slice(1, -2);
|
|
3312
|
+
if (filter(body)) {
|
|
3313
|
+
return `}${body.replace(/[^\n]/g, fillChar)}\${`;
|
|
3338
3314
|
}
|
|
3339
|
-
result += token.value;
|
|
3340
3315
|
}
|
|
3316
|
+
return token.value;
|
|
3317
|
+
}
|
|
3318
|
+
__name(stripLiteralFromToken, "stripLiteralFromToken");
|
|
3319
|
+
function optionsWithDefaults(options) {
|
|
3341
3320
|
return {
|
|
3342
|
-
|
|
3343
|
-
|
|
3321
|
+
fillChar: options?.fillChar ?? " ",
|
|
3322
|
+
filter: options?.filter ?? (() => true)
|
|
3344
3323
|
};
|
|
3345
3324
|
}
|
|
3346
|
-
__name(
|
|
3325
|
+
__name(optionsWithDefaults, "optionsWithDefaults");
|
|
3347
3326
|
function stripLiteral(code, options) {
|
|
3348
|
-
|
|
3327
|
+
let result = "";
|
|
3328
|
+
const _options = optionsWithDefaults(options);
|
|
3329
|
+
for (const token of (0, import_js_tokens.default)(code, { jsx: false })) {
|
|
3330
|
+
result += stripLiteralFromToken(token, _options.fillChar, _options.filter);
|
|
3331
|
+
}
|
|
3332
|
+
return result;
|
|
3349
3333
|
}
|
|
3350
3334
|
__name(stripLiteral, "stripLiteral");
|
|
3351
|
-
function stripLiteralDetailed(code, options) {
|
|
3352
|
-
return stripLiteralJsTokens(code, options);
|
|
3353
|
-
}
|
|
3354
|
-
__name(stripLiteralDetailed, "stripLiteralDetailed");
|
|
3355
3335
|
|
|
3356
|
-
// ../../node_modules/.pnpm/@vitest+runner@3.2.
|
|
3336
|
+
// ../../node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/chunk-hooks.js
|
|
3357
3337
|
var PendingError = class PendingError2 extends Error {
|
|
3358
3338
|
static {
|
|
3359
3339
|
__name(this, "PendingError");
|
|
@@ -4066,7 +4046,8 @@ function createTaskCollector(fn, context) {
|
|
|
4066
4046
|
};
|
|
4067
4047
|
taskFn.extend = function(fixtures) {
|
|
4068
4048
|
const _context = mergeContextFixtures(fixtures, context || {}, runner);
|
|
4069
|
-
|
|
4049
|
+
const originalWrapper = fn;
|
|
4050
|
+
return createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
4070
4051
|
const collector = getCurrentSuite();
|
|
4071
4052
|
const scopedFixtures = collector.fixtures();
|
|
4072
4053
|
const context2 = {
|
|
@@ -4075,8 +4056,10 @@ function createTaskCollector(fn, context) {
|
|
|
4075
4056
|
if (scopedFixtures) {
|
|
4076
4057
|
context2.fixtures = mergeScopedFixtures(context2.fixtures || [], scopedFixtures);
|
|
4077
4058
|
}
|
|
4078
|
-
|
|
4079
|
-
|
|
4059
|
+
const { handler, options } = parseArguments(optionsOrFn, optionsOrTest);
|
|
4060
|
+
const timeout = options.timeout ?? (void 0 );
|
|
4061
|
+
originalWrapper.call(context2, formatName(name), handler, timeout);
|
|
4062
|
+
}, _context);
|
|
4080
4063
|
};
|
|
4081
4064
|
const _test2 = createChainable([
|
|
4082
4065
|
"concurrent",
|
|
@@ -4469,35 +4452,25 @@ function createTestHook(name, handler) {
|
|
|
4469
4452
|
}
|
|
4470
4453
|
__name(createTestHook, "createTestHook");
|
|
4471
4454
|
|
|
4472
|
-
// ../../node_modules/.pnpm/@vitest+runner@3.2.
|
|
4455
|
+
// ../../node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/index.js
|
|
4473
4456
|
init_esm_shims();
|
|
4474
4457
|
|
|
4475
|
-
// ../../node_modules/.pnpm/vitest@3.2.
|
|
4458
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.1_jiti@2.6.1_lightningcss@1.30.1_terser@5.44.1_tsx@4.20.6_yaml@2.8.1/node_modules/vitest/dist/index.js
|
|
4476
4459
|
init_esm_shims();
|
|
4477
4460
|
|
|
4478
|
-
// ../../node_modules/.pnpm/chai@5.
|
|
4461
|
+
// ../../node_modules/.pnpm/chai@5.3.3/node_modules/chai/index.js
|
|
4479
4462
|
init_esm_shims();
|
|
4480
4463
|
var __defProp = Object.defineProperty;
|
|
4481
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4482
4464
|
var __name2 = /* @__PURE__ */ __name((target, value) => __defProp(target, "name", {
|
|
4483
4465
|
value,
|
|
4484
4466
|
configurable: true
|
|
4485
4467
|
}), "__name");
|
|
4486
|
-
var __commonJS2 = /* @__PURE__ */ __name((cb, mod) => /* @__PURE__ */ __name(function __require2() {
|
|
4487
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = {
|
|
4488
|
-
exports: {}
|
|
4489
|
-
}).exports, mod), mod.exports;
|
|
4490
|
-
}, "__require"), "__commonJS");
|
|
4491
4468
|
var __export = /* @__PURE__ */ __name((target, all) => {
|
|
4492
4469
|
for (var name in all) __defProp(target, name, {
|
|
4493
4470
|
get: all[name],
|
|
4494
4471
|
enumerable: true
|
|
4495
4472
|
});
|
|
4496
4473
|
}, "__export");
|
|
4497
|
-
var require_util = __commonJS2({
|
|
4498
|
-
"(disabled):util"() {
|
|
4499
|
-
}
|
|
4500
|
-
});
|
|
4501
4474
|
var utils_exports = {};
|
|
4502
4475
|
__export(utils_exports, {
|
|
4503
4476
|
addChainableMethod: /* @__PURE__ */ __name(() => addChainableMethod, "addChainableMethod"),
|
|
@@ -4602,7 +4575,7 @@ function getMessage(errorLike) {
|
|
|
4602
4575
|
__name(getMessage, "getMessage");
|
|
4603
4576
|
__name2(getMessage, "getMessage");
|
|
4604
4577
|
function flag(obj, key, value) {
|
|
4605
|
-
|
|
4578
|
+
let flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null));
|
|
4606
4579
|
if (arguments.length === 3) {
|
|
4607
4580
|
flags[key] = value;
|
|
4608
4581
|
} else {
|
|
@@ -4612,7 +4585,7 @@ function flag(obj, key, value) {
|
|
|
4612
4585
|
__name(flag, "flag");
|
|
4613
4586
|
__name2(flag, "flag");
|
|
4614
4587
|
function test3(obj, args) {
|
|
4615
|
-
|
|
4588
|
+
let negate = flag(obj, "negate"), expr = args[0];
|
|
4616
4589
|
return negate ? !expr : expr;
|
|
4617
4590
|
}
|
|
4618
4591
|
__name(test3, "test");
|
|
@@ -4671,26 +4644,26 @@ var AssertionError = class _AssertionError extends Error {
|
|
|
4671
4644
|
}
|
|
4672
4645
|
};
|
|
4673
4646
|
function expectTypes(obj, types) {
|
|
4674
|
-
|
|
4675
|
-
|
|
4647
|
+
let flagMsg = flag(obj, "message");
|
|
4648
|
+
let ssfi = flag(obj, "ssfi");
|
|
4676
4649
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
4677
4650
|
obj = flag(obj, "object");
|
|
4678
4651
|
types = types.map(function(t) {
|
|
4679
4652
|
return t.toLowerCase();
|
|
4680
4653
|
});
|
|
4681
4654
|
types.sort();
|
|
4682
|
-
|
|
4683
|
-
|
|
4655
|
+
let str = types.map(function(t, index2) {
|
|
4656
|
+
let art = ~[
|
|
4684
4657
|
"a",
|
|
4685
4658
|
"e",
|
|
4686
4659
|
"i",
|
|
4687
4660
|
"o",
|
|
4688
4661
|
"u"
|
|
4689
4662
|
].indexOf(t.charAt(0)) ? "an" : "a";
|
|
4690
|
-
|
|
4663
|
+
let or = types.length > 1 && index2 === types.length - 1 ? "or " : "";
|
|
4691
4664
|
return or + art + " " + t;
|
|
4692
4665
|
}).join(", ");
|
|
4693
|
-
|
|
4666
|
+
let objType = type(obj).toLowerCase();
|
|
4694
4667
|
if (!types.some(function(expected) {
|
|
4695
4668
|
return objType === expected;
|
|
4696
4669
|
})) {
|
|
@@ -5037,10 +5010,7 @@ function mapToEntries2(map) {
|
|
|
5037
5010
|
__name(mapToEntries2, "mapToEntries");
|
|
5038
5011
|
__name2(mapToEntries2, "mapToEntries");
|
|
5039
5012
|
function inspectMap2(map, options) {
|
|
5040
|
-
|
|
5041
|
-
if (size <= 0) {
|
|
5042
|
-
return "Map{}";
|
|
5043
|
-
}
|
|
5013
|
+
if (map.size === 0) return "Map{}";
|
|
5044
5014
|
options.truncate -= 7;
|
|
5045
5015
|
return `Map{ ${inspectList2(mapToEntries2(map), options, inspectMapEntry2)} }`;
|
|
5046
5016
|
}
|
|
@@ -5128,19 +5098,6 @@ function inspectSymbol2(value) {
|
|
|
5128
5098
|
__name(inspectSymbol2, "inspectSymbol");
|
|
5129
5099
|
__name2(inspectSymbol2, "inspectSymbol");
|
|
5130
5100
|
var getPromiseValue2 = /* @__PURE__ */ __name2(() => "Promise{\u2026}", "getPromiseValue");
|
|
5131
|
-
try {
|
|
5132
|
-
const { getPromiseDetails, kPending, kRejected } = process.binding("util");
|
|
5133
|
-
if (Array.isArray(getPromiseDetails(Promise.resolve()))) {
|
|
5134
|
-
getPromiseValue2 = /* @__PURE__ */ __name2((value, options) => {
|
|
5135
|
-
const [state, innerValue] = getPromiseDetails(value);
|
|
5136
|
-
if (state === kPending) {
|
|
5137
|
-
return "Promise{<pending>}";
|
|
5138
|
-
}
|
|
5139
|
-
return `Promise${state === kRejected ? "!" : ""}{${options.inspect(innerValue, options)}}`;
|
|
5140
|
-
}, "getPromiseValue");
|
|
5141
|
-
}
|
|
5142
|
-
} catch (notNode) {
|
|
5143
|
-
}
|
|
5144
5101
|
var promise_default2 = getPromiseValue2;
|
|
5145
5102
|
function inspectObject3(object, options) {
|
|
5146
5103
|
const properties = Object.getOwnPropertyNames(object);
|
|
@@ -5240,11 +5197,23 @@ function inspectAttribute2([key, value], options) {
|
|
|
5240
5197
|
}
|
|
5241
5198
|
__name(inspectAttribute2, "inspectAttribute");
|
|
5242
5199
|
__name2(inspectAttribute2, "inspectAttribute");
|
|
5243
|
-
function
|
|
5244
|
-
return inspectList2(collection, options,
|
|
5200
|
+
function inspectNodeCollection2(collection, options) {
|
|
5201
|
+
return inspectList2(collection, options, inspectNode2, "\n");
|
|
5202
|
+
}
|
|
5203
|
+
__name(inspectNodeCollection2, "inspectNodeCollection");
|
|
5204
|
+
__name2(inspectNodeCollection2, "inspectNodeCollection");
|
|
5205
|
+
function inspectNode2(node, options) {
|
|
5206
|
+
switch (node.nodeType) {
|
|
5207
|
+
case 1:
|
|
5208
|
+
return inspectHTML2(node, options);
|
|
5209
|
+
case 3:
|
|
5210
|
+
return options.inspect(node.data, options);
|
|
5211
|
+
default:
|
|
5212
|
+
return options.inspect(node, options);
|
|
5213
|
+
}
|
|
5245
5214
|
}
|
|
5246
|
-
__name(
|
|
5247
|
-
__name2(
|
|
5215
|
+
__name(inspectNode2, "inspectNode");
|
|
5216
|
+
__name2(inspectNode2, "inspectNode");
|
|
5248
5217
|
function inspectHTML2(element, options) {
|
|
5249
5218
|
const properties = element.getAttributeNames();
|
|
5250
5219
|
const name = element.tagName.toLowerCase();
|
|
@@ -5262,7 +5231,7 @@ function inspectHTML2(element, options) {
|
|
|
5262
5231
|
}
|
|
5263
5232
|
options.truncate -= propertyContents.length;
|
|
5264
5233
|
const truncate22 = options.truncate;
|
|
5265
|
-
let children =
|
|
5234
|
+
let children = inspectNodeCollection2(element.children, options);
|
|
5266
5235
|
if (children && children.length > truncate22) {
|
|
5267
5236
|
children = `${truncator2}(${element.children.length})`;
|
|
5268
5237
|
}
|
|
@@ -5272,20 +5241,14 @@ __name(inspectHTML2, "inspectHTML");
|
|
|
5272
5241
|
__name2(inspectHTML2, "inspectHTML");
|
|
5273
5242
|
var symbolsSupported2 = typeof Symbol === "function" && typeof Symbol.for === "function";
|
|
5274
5243
|
var chaiInspect2 = symbolsSupported2 ? Symbol.for("chai/inspect") : "@@chai/inspect";
|
|
5275
|
-
var nodeInspect2 =
|
|
5276
|
-
try {
|
|
5277
|
-
const nodeUtil = require_util();
|
|
5278
|
-
nodeInspect2 = nodeUtil.inspect ? nodeUtil.inspect.custom : false;
|
|
5279
|
-
} catch (noNodeInspect) {
|
|
5280
|
-
nodeInspect2 = false;
|
|
5281
|
-
}
|
|
5244
|
+
var nodeInspect2 = Symbol.for("nodejs.util.inspect.custom");
|
|
5282
5245
|
var constructorMap2 = /* @__PURE__ */ new WeakMap();
|
|
5283
5246
|
var stringTagMap2 = {};
|
|
5284
5247
|
var baseTypesMap2 = {
|
|
5285
|
-
undefined: /* @__PURE__ */
|
|
5286
|
-
null: /* @__PURE__ */
|
|
5287
|
-
boolean: /* @__PURE__ */
|
|
5288
|
-
Boolean: /* @__PURE__ */
|
|
5248
|
+
undefined: /* @__PURE__ */ __name2((value, options) => options.stylize("undefined", "undefined"), "undefined"),
|
|
5249
|
+
null: /* @__PURE__ */ __name2((value, options) => options.stylize("null", "null"), "null"),
|
|
5250
|
+
boolean: /* @__PURE__ */ __name2((value, options) => options.stylize(String(value), "boolean"), "boolean"),
|
|
5251
|
+
Boolean: /* @__PURE__ */ __name2((value, options) => options.stylize(String(value), "boolean"), "Boolean"),
|
|
5289
5252
|
number: inspectNumber2,
|
|
5290
5253
|
Number: inspectNumber2,
|
|
5291
5254
|
bigint: inspectBigInt2,
|
|
@@ -5304,8 +5267,8 @@ var baseTypesMap2 = {
|
|
|
5304
5267
|
RegExp: inspectRegExp2,
|
|
5305
5268
|
Promise: promise_default2,
|
|
5306
5269
|
// WeakSet, WeakMap are totally opaque to us
|
|
5307
|
-
WeakSet: /* @__PURE__ */
|
|
5308
|
-
WeakMap: /* @__PURE__ */
|
|
5270
|
+
WeakSet: /* @__PURE__ */ __name2((value, options) => options.stylize("WeakSet{\u2026}", "special"), "WeakSet"),
|
|
5271
|
+
WeakMap: /* @__PURE__ */ __name2((value, options) => options.stylize("WeakMap{\u2026}", "special"), "WeakMap"),
|
|
5309
5272
|
Arguments: inspectArguments2,
|
|
5310
5273
|
Int8Array: inspectTypedArray2,
|
|
5311
5274
|
Uint8Array: inspectTypedArray2,
|
|
@@ -5316,18 +5279,18 @@ var baseTypesMap2 = {
|
|
|
5316
5279
|
Uint32Array: inspectTypedArray2,
|
|
5317
5280
|
Float32Array: inspectTypedArray2,
|
|
5318
5281
|
Float64Array: inspectTypedArray2,
|
|
5319
|
-
Generator: /* @__PURE__ */
|
|
5320
|
-
DataView: /* @__PURE__ */
|
|
5321
|
-
ArrayBuffer: /* @__PURE__ */
|
|
5282
|
+
Generator: /* @__PURE__ */ __name2(() => "", "Generator"),
|
|
5283
|
+
DataView: /* @__PURE__ */ __name2(() => "", "DataView"),
|
|
5284
|
+
ArrayBuffer: /* @__PURE__ */ __name2(() => "", "ArrayBuffer"),
|
|
5322
5285
|
Error: inspectObject22,
|
|
5323
|
-
HTMLCollection:
|
|
5324
|
-
NodeList:
|
|
5286
|
+
HTMLCollection: inspectNodeCollection2,
|
|
5287
|
+
NodeList: inspectNodeCollection2
|
|
5325
5288
|
};
|
|
5326
5289
|
var inspectCustom2 = /* @__PURE__ */ __name2((value, options, type3) => {
|
|
5327
5290
|
if (chaiInspect2 in value && typeof value[chaiInspect2] === "function") {
|
|
5328
5291
|
return value[chaiInspect2](options);
|
|
5329
5292
|
}
|
|
5330
|
-
if (nodeInspect2
|
|
5293
|
+
if (nodeInspect2 in value && typeof value[nodeInspect2] === "function") {
|
|
5331
5294
|
return value[nodeInspect2](options.depth, options);
|
|
5332
5295
|
}
|
|
5333
5296
|
if ("inspect" in value && typeof value.inspect === "function") {
|
|
@@ -5492,7 +5455,7 @@ var config = {
|
|
|
5492
5455
|
deepEqual: null
|
|
5493
5456
|
};
|
|
5494
5457
|
function inspect22(obj, showHidden, depth, colors) {
|
|
5495
|
-
|
|
5458
|
+
let options = {
|
|
5496
5459
|
colors,
|
|
5497
5460
|
depth: typeof depth === "undefined" ? 2 : depth,
|
|
5498
5461
|
showHidden,
|
|
@@ -5503,14 +5466,14 @@ function inspect22(obj, showHidden, depth, colors) {
|
|
|
5503
5466
|
__name(inspect22, "inspect2");
|
|
5504
5467
|
__name2(inspect22, "inspect");
|
|
5505
5468
|
function objDisplay2(obj) {
|
|
5506
|
-
|
|
5469
|
+
let str = inspect22(obj), type3 = Object.prototype.toString.call(obj);
|
|
5507
5470
|
if (config.truncateThreshold && str.length >= config.truncateThreshold) {
|
|
5508
5471
|
if (type3 === "[object Function]") {
|
|
5509
5472
|
return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]";
|
|
5510
5473
|
} else if (type3 === "[object Array]") {
|
|
5511
5474
|
return "[ Array(" + obj.length + ") ]";
|
|
5512
5475
|
} else if (type3 === "[object Object]") {
|
|
5513
|
-
|
|
5476
|
+
let keys = Object.keys(obj), kstr = keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", ");
|
|
5514
5477
|
return "{ Object (" + kstr + ") }";
|
|
5515
5478
|
} else {
|
|
5516
5479
|
return str;
|
|
@@ -5522,7 +5485,12 @@ function objDisplay2(obj) {
|
|
|
5522
5485
|
__name(objDisplay2, "objDisplay");
|
|
5523
5486
|
__name2(objDisplay2, "objDisplay");
|
|
5524
5487
|
function getMessage2(obj, args) {
|
|
5525
|
-
|
|
5488
|
+
let negate = flag(obj, "negate");
|
|
5489
|
+
let val = flag(obj, "object");
|
|
5490
|
+
let expected = args[3];
|
|
5491
|
+
let actual = getActual(obj, args);
|
|
5492
|
+
let msg = negate ? args[2] : args[1];
|
|
5493
|
+
let flagMsg = flag(obj, "message");
|
|
5526
5494
|
if (typeof msg === "function") msg = msg();
|
|
5527
5495
|
msg = msg || "";
|
|
5528
5496
|
msg = msg.replace(/#\{this\}/g, function() {
|
|
@@ -5537,12 +5505,12 @@ function getMessage2(obj, args) {
|
|
|
5537
5505
|
__name(getMessage2, "getMessage2");
|
|
5538
5506
|
__name2(getMessage2, "getMessage");
|
|
5539
5507
|
function transferFlags(assertion, object, includeAll) {
|
|
5540
|
-
|
|
5508
|
+
let flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null));
|
|
5541
5509
|
if (!object.__flags) {
|
|
5542
5510
|
object.__flags = /* @__PURE__ */ Object.create(null);
|
|
5543
5511
|
}
|
|
5544
5512
|
includeAll = arguments.length === 3 ? includeAll : true;
|
|
5545
|
-
for (
|
|
5513
|
+
for (let flag3 in flags) {
|
|
5546
5514
|
if (includeAll || flag3 !== "object" && flag3 !== "ssfi" && flag3 !== "lockSsfi" && flag3 != "message") {
|
|
5547
5515
|
object.__flags[flag3] = flags[flag3];
|
|
5548
5516
|
}
|
|
@@ -5972,82 +5940,178 @@ function getPathInfo(obj, path) {
|
|
|
5972
5940
|
}
|
|
5973
5941
|
__name(getPathInfo, "getPathInfo");
|
|
5974
5942
|
__name2(getPathInfo, "getPathInfo");
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
}
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5943
|
+
var Assertion = class _Assertion {
|
|
5944
|
+
static {
|
|
5945
|
+
__name(this, "_Assertion");
|
|
5946
|
+
}
|
|
5947
|
+
static {
|
|
5948
|
+
__name2(this, "Assertion");
|
|
5949
|
+
}
|
|
5950
|
+
/** @type {{}} */
|
|
5951
|
+
__flags = {};
|
|
5952
|
+
/**
|
|
5953
|
+
* Creates object for chaining.
|
|
5954
|
+
* `Assertion` objects contain metadata in the form of flags. Three flags can
|
|
5955
|
+
* be assigned during instantiation by passing arguments to this constructor:
|
|
5956
|
+
*
|
|
5957
|
+
* - `object`: This flag contains the target of the assertion. For example, in
|
|
5958
|
+
* the assertion `expect(numKittens).to.equal(7);`, the `object` flag will
|
|
5959
|
+
* contain `numKittens` so that the `equal` assertion can reference it when
|
|
5960
|
+
* needed.
|
|
5961
|
+
*
|
|
5962
|
+
* - `message`: This flag contains an optional custom error message to be
|
|
5963
|
+
* prepended to the error message that's generated by the assertion when it
|
|
5964
|
+
* fails.
|
|
5965
|
+
*
|
|
5966
|
+
* - `ssfi`: This flag stands for "start stack function indicator". It
|
|
5967
|
+
* contains a function reference that serves as the starting point for
|
|
5968
|
+
* removing frames from the stack trace of the error that's created by the
|
|
5969
|
+
* assertion when it fails. The goal is to provide a cleaner stack trace to
|
|
5970
|
+
* end users by removing Chai's internal functions. Note that it only works
|
|
5971
|
+
* in environments that support `Error.captureStackTrace`, and only when
|
|
5972
|
+
* `Chai.config.includeStack` hasn't been set to `false`.
|
|
5973
|
+
*
|
|
5974
|
+
* - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
|
|
5975
|
+
* should retain its current value, even as assertions are chained off of
|
|
5976
|
+
* this object. This is usually set to `true` when creating a new assertion
|
|
5977
|
+
* from within another assertion. It's also temporarily set to `true` before
|
|
5978
|
+
* an overwritten assertion gets called by the overwriting assertion.
|
|
5979
|
+
*
|
|
5980
|
+
* - `eql`: This flag contains the deepEqual function to be used by the assertion.
|
|
5981
|
+
*
|
|
5982
|
+
* @param {unknown} obj target of the assertion
|
|
5983
|
+
* @param {string} [msg] (optional) custom error message
|
|
5984
|
+
* @param {Function} [ssfi] (optional) starting point for removing stack frames
|
|
5985
|
+
* @param {boolean} [lockSsfi] (optional) whether or not the ssfi flag is locked
|
|
5986
|
+
*/
|
|
5987
|
+
constructor(obj, msg, ssfi, lockSsfi) {
|
|
5988
|
+
flag(this, "ssfi", ssfi || _Assertion);
|
|
5989
|
+
flag(this, "lockSsfi", lockSsfi);
|
|
5990
|
+
flag(this, "object", obj);
|
|
5991
|
+
flag(this, "message", msg);
|
|
5992
|
+
flag(this, "eql", config.deepEqual || deep_eql_default);
|
|
5993
|
+
return proxify(this);
|
|
5994
|
+
}
|
|
5995
|
+
/** @returns {boolean} */
|
|
5996
|
+
static get includeStack() {
|
|
5987
5997
|
console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");
|
|
5988
5998
|
return config.includeStack;
|
|
5989
|
-
}
|
|
5990
|
-
|
|
5999
|
+
}
|
|
6000
|
+
/** @param {boolean} value */
|
|
6001
|
+
static set includeStack(value) {
|
|
5991
6002
|
console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead.");
|
|
5992
6003
|
config.includeStack = value;
|
|
5993
|
-
}
|
|
5994
|
-
}
|
|
5995
|
-
|
|
5996
|
-
get: /* @__PURE__ */ __name(function() {
|
|
6004
|
+
}
|
|
6005
|
+
/** @returns {boolean} */
|
|
6006
|
+
static get showDiff() {
|
|
5997
6007
|
console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");
|
|
5998
6008
|
return config.showDiff;
|
|
5999
|
-
}
|
|
6000
|
-
|
|
6009
|
+
}
|
|
6010
|
+
/** @param {boolean} value */
|
|
6011
|
+
static set showDiff(value) {
|
|
6001
6012
|
console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead.");
|
|
6002
6013
|
config.showDiff = value;
|
|
6003
|
-
}
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
}
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
}
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
}
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6014
|
+
}
|
|
6015
|
+
/**
|
|
6016
|
+
* @param {string} name
|
|
6017
|
+
* @param {Function} fn
|
|
6018
|
+
*/
|
|
6019
|
+
static addProperty(name, fn) {
|
|
6020
|
+
addProperty(this.prototype, name, fn);
|
|
6021
|
+
}
|
|
6022
|
+
/**
|
|
6023
|
+
* @param {string} name
|
|
6024
|
+
* @param {Function} fn
|
|
6025
|
+
*/
|
|
6026
|
+
static addMethod(name, fn) {
|
|
6027
|
+
addMethod(this.prototype, name, fn);
|
|
6028
|
+
}
|
|
6029
|
+
/**
|
|
6030
|
+
* @param {string} name
|
|
6031
|
+
* @param {Function} fn
|
|
6032
|
+
* @param {Function} chainingBehavior
|
|
6033
|
+
*/
|
|
6034
|
+
static addChainableMethod(name, fn, chainingBehavior) {
|
|
6035
|
+
addChainableMethod(this.prototype, name, fn, chainingBehavior);
|
|
6036
|
+
}
|
|
6037
|
+
/**
|
|
6038
|
+
* @param {string} name
|
|
6039
|
+
* @param {Function} fn
|
|
6040
|
+
*/
|
|
6041
|
+
static overwriteProperty(name, fn) {
|
|
6042
|
+
overwriteProperty(this.prototype, name, fn);
|
|
6043
|
+
}
|
|
6044
|
+
/**
|
|
6045
|
+
* @param {string} name
|
|
6046
|
+
* @param {Function} fn
|
|
6047
|
+
*/
|
|
6048
|
+
static overwriteMethod(name, fn) {
|
|
6049
|
+
overwriteMethod(this.prototype, name, fn);
|
|
6050
|
+
}
|
|
6051
|
+
/**
|
|
6052
|
+
* @param {string} name
|
|
6053
|
+
* @param {Function} fn
|
|
6054
|
+
* @param {Function} chainingBehavior
|
|
6055
|
+
*/
|
|
6056
|
+
static overwriteChainableMethod(name, fn, chainingBehavior) {
|
|
6057
|
+
overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
|
|
6058
|
+
}
|
|
6059
|
+
/**
|
|
6060
|
+
* ### .assert(expression, message, negateMessage, expected, actual, showDiff)
|
|
6061
|
+
*
|
|
6062
|
+
* Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
|
|
6063
|
+
*
|
|
6064
|
+
* @name assert
|
|
6065
|
+
* @param {unknown} _expr to be tested
|
|
6066
|
+
* @param {string | Function} msg or function that returns message to display if expression fails
|
|
6067
|
+
* @param {string | Function} _negateMsg or function that returns negatedMessage to display if negated expression fails
|
|
6068
|
+
* @param {unknown} expected value (remember to check for negation)
|
|
6069
|
+
* @param {unknown} _actual (optional) will default to `this.obj`
|
|
6070
|
+
* @param {boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
|
|
6071
|
+
* @returns {void}
|
|
6072
|
+
*/
|
|
6073
|
+
assert(_expr, msg, _negateMsg, expected, _actual, showDiff) {
|
|
6074
|
+
const ok = test3(this, arguments);
|
|
6075
|
+
if (false !== showDiff) showDiff = true;
|
|
6076
|
+
if (void 0 === expected && void 0 === _actual) showDiff = false;
|
|
6077
|
+
if (true !== config.showDiff) showDiff = false;
|
|
6078
|
+
if (!ok) {
|
|
6079
|
+
msg = getMessage2(this, arguments);
|
|
6080
|
+
const actual = getActual(this, arguments);
|
|
6081
|
+
const assertionErrorObjectProperties = {
|
|
6082
|
+
actual,
|
|
6083
|
+
expected,
|
|
6084
|
+
showDiff
|
|
6085
|
+
};
|
|
6086
|
+
const operator = getOperator(this, arguments);
|
|
6087
|
+
if (operator) {
|
|
6088
|
+
assertionErrorObjectProperties.operator = operator;
|
|
6089
|
+
}
|
|
6090
|
+
throw new AssertionError(
|
|
6091
|
+
msg,
|
|
6092
|
+
assertionErrorObjectProperties,
|
|
6093
|
+
// @ts-expect-error Not sure what to do about these types yet
|
|
6094
|
+
config.includeStack ? this.assert : flag(this, "ssfi")
|
|
6095
|
+
);
|
|
6039
6096
|
}
|
|
6040
|
-
throw new AssertionError(msg, assertionErrorObjectProperties, config.includeStack ? this.assert : flag(this, "ssfi"));
|
|
6041
6097
|
}
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6098
|
+
/**
|
|
6099
|
+
* Quick reference to stored `actual` value for plugin developers.
|
|
6100
|
+
*
|
|
6101
|
+
* @returns {unknown}
|
|
6102
|
+
*/
|
|
6103
|
+
get _obj() {
|
|
6045
6104
|
return flag(this, "object");
|
|
6046
|
-
}
|
|
6047
|
-
|
|
6105
|
+
}
|
|
6106
|
+
/**
|
|
6107
|
+
* Quick reference to stored `actual` value for plugin developers.
|
|
6108
|
+
*
|
|
6109
|
+
* @param {unknown} val
|
|
6110
|
+
*/
|
|
6111
|
+
set _obj(val) {
|
|
6048
6112
|
flag(this, "object", val);
|
|
6049
|
-
}
|
|
6050
|
-
}
|
|
6113
|
+
}
|
|
6114
|
+
};
|
|
6051
6115
|
function isProxyEnabled() {
|
|
6052
6116
|
return config.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined";
|
|
6053
6117
|
}
|
|
@@ -6061,9 +6125,9 @@ function addProperty(ctx, name, getter) {
|
|
|
6061
6125
|
if (!isProxyEnabled() && !flag(this, "lockSsfi")) {
|
|
6062
6126
|
flag(this, "ssfi", propertyGetter);
|
|
6063
6127
|
}
|
|
6064
|
-
|
|
6128
|
+
let result = getter.call(this);
|
|
6065
6129
|
if (result !== void 0) return result;
|
|
6066
|
-
|
|
6130
|
+
let newAssertion = new Assertion();
|
|
6067
6131
|
transferFlags(this, newAssertion);
|
|
6068
6132
|
return newAssertion;
|
|
6069
6133
|
}, "propertyGetter"), "propertyGetter"),
|
|
@@ -6077,7 +6141,7 @@ var fnLengthDesc = Object.getOwnPropertyDescriptor(function() {
|
|
|
6077
6141
|
function addLengthGuard(fn, assertionName, isChainable) {
|
|
6078
6142
|
if (!fnLengthDesc.configurable) return fn;
|
|
6079
6143
|
Object.defineProperty(fn, "length", {
|
|
6080
|
-
get: /* @__PURE__ */
|
|
6144
|
+
get: /* @__PURE__ */ __name2(function() {
|
|
6081
6145
|
if (isChainable) {
|
|
6082
6146
|
throw Error("Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.');
|
|
6083
6147
|
}
|
|
@@ -6089,7 +6153,7 @@ function addLengthGuard(fn, assertionName, isChainable) {
|
|
|
6089
6153
|
__name(addLengthGuard, "addLengthGuard");
|
|
6090
6154
|
__name2(addLengthGuard, "addLengthGuard");
|
|
6091
6155
|
function getProperties(object) {
|
|
6092
|
-
|
|
6156
|
+
let result = Object.getOwnPropertyNames(object);
|
|
6093
6157
|
function addProperty2(property) {
|
|
6094
6158
|
if (result.indexOf(property) === -1) {
|
|
6095
6159
|
result.push(property);
|
|
@@ -6097,7 +6161,7 @@ function getProperties(object) {
|
|
|
6097
6161
|
}
|
|
6098
6162
|
__name(addProperty2, "addProperty2");
|
|
6099
6163
|
__name2(addProperty2, "addProperty");
|
|
6100
|
-
|
|
6164
|
+
let proto = Object.getPrototypeOf(object);
|
|
6101
6165
|
while (proto !== null) {
|
|
6102
6166
|
Object.getOwnPropertyNames(proto).forEach(addProperty2);
|
|
6103
6167
|
proto = Object.getPrototypeOf(proto);
|
|
@@ -6120,15 +6184,15 @@ function proxify(obj, nonChainableMethodName) {
|
|
|
6120
6184
|
if (nonChainableMethodName) {
|
|
6121
6185
|
throw Error("Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".');
|
|
6122
6186
|
}
|
|
6123
|
-
|
|
6124
|
-
|
|
6187
|
+
let suggestion = null;
|
|
6188
|
+
let suggestionDistance = 4;
|
|
6125
6189
|
getProperties(target).forEach(function(prop) {
|
|
6126
6190
|
if (
|
|
6127
6191
|
// we actually mean to check `Object.prototype` here
|
|
6128
6192
|
// eslint-disable-next-line no-prototype-builtins
|
|
6129
6193
|
!Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1
|
|
6130
6194
|
) {
|
|
6131
|
-
|
|
6195
|
+
let dist = stringDistanceCapped(property, prop, suggestionDistance);
|
|
6132
6196
|
if (dist < suggestionDistance) {
|
|
6133
6197
|
suggestion = prop;
|
|
6134
6198
|
suggestionDistance = dist;
|
|
@@ -6154,7 +6218,7 @@ function stringDistanceCapped(strA, strB, cap) {
|
|
|
6154
6218
|
if (Math.abs(strA.length - strB.length) >= cap) {
|
|
6155
6219
|
return cap;
|
|
6156
6220
|
}
|
|
6157
|
-
|
|
6221
|
+
let memo = [];
|
|
6158
6222
|
for (let i = 0; i <= strA.length; i++) {
|
|
6159
6223
|
memo[i] = Array(strB.length + 1).fill(0);
|
|
6160
6224
|
memo[i][0] = i;
|
|
@@ -6163,7 +6227,7 @@ function stringDistanceCapped(strA, strB, cap) {
|
|
|
6163
6227
|
memo[0][j] = j;
|
|
6164
6228
|
}
|
|
6165
6229
|
for (let i = 1; i <= strA.length; i++) {
|
|
6166
|
-
|
|
6230
|
+
let ch = strA.charCodeAt(i - 1);
|
|
6167
6231
|
for (let j = 1; j <= strB.length; j++) {
|
|
6168
6232
|
if (Math.abs(i - j) >= cap) {
|
|
6169
6233
|
memo[i][j] = cap;
|
|
@@ -6177,13 +6241,13 @@ function stringDistanceCapped(strA, strB, cap) {
|
|
|
6177
6241
|
__name(stringDistanceCapped, "stringDistanceCapped");
|
|
6178
6242
|
__name2(stringDistanceCapped, "stringDistanceCapped");
|
|
6179
6243
|
function addMethod(ctx, name, method) {
|
|
6180
|
-
|
|
6244
|
+
let methodWrapper = /* @__PURE__ */ __name2(function() {
|
|
6181
6245
|
if (!flag(this, "lockSsfi")) {
|
|
6182
6246
|
flag(this, "ssfi", methodWrapper);
|
|
6183
6247
|
}
|
|
6184
|
-
|
|
6248
|
+
let result = method.apply(this, arguments);
|
|
6185
6249
|
if (result !== void 0) return result;
|
|
6186
|
-
|
|
6250
|
+
let newAssertion = new Assertion();
|
|
6187
6251
|
transferFlags(this, newAssertion);
|
|
6188
6252
|
return newAssertion;
|
|
6189
6253
|
}, "methodWrapper");
|
|
@@ -6193,7 +6257,7 @@ function addMethod(ctx, name, method) {
|
|
|
6193
6257
|
__name(addMethod, "addMethod");
|
|
6194
6258
|
__name2(addMethod, "addMethod");
|
|
6195
6259
|
function overwriteProperty(ctx, name, getter) {
|
|
6196
|
-
|
|
6260
|
+
let _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ __name2(function() {
|
|
6197
6261
|
}, "_super");
|
|
6198
6262
|
if (_get && "function" === typeof _get.get) _super = _get.get;
|
|
6199
6263
|
Object.defineProperty(ctx, name, {
|
|
@@ -6201,14 +6265,14 @@ function overwriteProperty(ctx, name, getter) {
|
|
|
6201
6265
|
if (!isProxyEnabled() && !flag(this, "lockSsfi")) {
|
|
6202
6266
|
flag(this, "ssfi", overwritingPropertyGetter);
|
|
6203
6267
|
}
|
|
6204
|
-
|
|
6268
|
+
let origLockSsfi = flag(this, "lockSsfi");
|
|
6205
6269
|
flag(this, "lockSsfi", true);
|
|
6206
|
-
|
|
6270
|
+
let result = getter(_super).call(this);
|
|
6207
6271
|
flag(this, "lockSsfi", origLockSsfi);
|
|
6208
6272
|
if (result !== void 0) {
|
|
6209
6273
|
return result;
|
|
6210
6274
|
}
|
|
6211
|
-
|
|
6275
|
+
let newAssertion = new Assertion();
|
|
6212
6276
|
transferFlags(this, newAssertion);
|
|
6213
6277
|
return newAssertion;
|
|
6214
6278
|
}, "overwritingPropertyGetter"), "overwritingPropertyGetter"),
|
|
@@ -6218,22 +6282,22 @@ function overwriteProperty(ctx, name, getter) {
|
|
|
6218
6282
|
__name(overwriteProperty, "overwriteProperty");
|
|
6219
6283
|
__name2(overwriteProperty, "overwriteProperty");
|
|
6220
6284
|
function overwriteMethod(ctx, name, method) {
|
|
6221
|
-
|
|
6285
|
+
let _method = ctx[name], _super = /* @__PURE__ */ __name2(function() {
|
|
6222
6286
|
throw new Error(name + " is not a function");
|
|
6223
6287
|
}, "_super");
|
|
6224
6288
|
if (_method && "function" === typeof _method) _super = _method;
|
|
6225
|
-
|
|
6289
|
+
let overwritingMethodWrapper = /* @__PURE__ */ __name2(function() {
|
|
6226
6290
|
if (!flag(this, "lockSsfi")) {
|
|
6227
6291
|
flag(this, "ssfi", overwritingMethodWrapper);
|
|
6228
6292
|
}
|
|
6229
|
-
|
|
6293
|
+
let origLockSsfi = flag(this, "lockSsfi");
|
|
6230
6294
|
flag(this, "lockSsfi", true);
|
|
6231
|
-
|
|
6295
|
+
let result = method(_super).apply(this, arguments);
|
|
6232
6296
|
flag(this, "lockSsfi", origLockSsfi);
|
|
6233
6297
|
if (result !== void 0) {
|
|
6234
6298
|
return result;
|
|
6235
6299
|
}
|
|
6236
|
-
|
|
6300
|
+
let newAssertion = new Assertion();
|
|
6237
6301
|
transferFlags(this, newAssertion);
|
|
6238
6302
|
return newAssertion;
|
|
6239
6303
|
}, "overwritingMethodWrapper");
|
|
@@ -6246,7 +6310,7 @@ var canSetPrototype = typeof Object.setPrototypeOf === "function";
|
|
|
6246
6310
|
var testFn = /* @__PURE__ */ __name2(function() {
|
|
6247
6311
|
}, "testFn");
|
|
6248
6312
|
var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
|
|
6249
|
-
|
|
6313
|
+
let propDesc = Object.getOwnPropertyDescriptor(testFn, name);
|
|
6250
6314
|
if (typeof propDesc !== "object") return true;
|
|
6251
6315
|
return !propDesc.configurable;
|
|
6252
6316
|
});
|
|
@@ -6257,7 +6321,7 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6257
6321
|
chainingBehavior = /* @__PURE__ */ __name2(function() {
|
|
6258
6322
|
}, "chainingBehavior");
|
|
6259
6323
|
}
|
|
6260
|
-
|
|
6324
|
+
let chainableBehavior = {
|
|
6261
6325
|
method,
|
|
6262
6326
|
chainingBehavior
|
|
6263
6327
|
};
|
|
@@ -6268,31 +6332,31 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6268
6332
|
Object.defineProperty(ctx, name, {
|
|
6269
6333
|
get: /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function chainableMethodGetter() {
|
|
6270
6334
|
chainableBehavior.chainingBehavior.call(this);
|
|
6271
|
-
|
|
6335
|
+
let chainableMethodWrapper = /* @__PURE__ */ __name2(function() {
|
|
6272
6336
|
if (!flag(this, "lockSsfi")) {
|
|
6273
6337
|
flag(this, "ssfi", chainableMethodWrapper);
|
|
6274
6338
|
}
|
|
6275
|
-
|
|
6339
|
+
let result = chainableBehavior.method.apply(this, arguments);
|
|
6276
6340
|
if (result !== void 0) {
|
|
6277
6341
|
return result;
|
|
6278
6342
|
}
|
|
6279
|
-
|
|
6343
|
+
let newAssertion = new Assertion();
|
|
6280
6344
|
transferFlags(this, newAssertion);
|
|
6281
6345
|
return newAssertion;
|
|
6282
6346
|
}, "chainableMethodWrapper");
|
|
6283
6347
|
addLengthGuard(chainableMethodWrapper, name, true);
|
|
6284
6348
|
if (canSetPrototype) {
|
|
6285
|
-
|
|
6349
|
+
let prototype = Object.create(this);
|
|
6286
6350
|
prototype.call = call;
|
|
6287
6351
|
prototype.apply = apply;
|
|
6288
6352
|
Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
|
6289
6353
|
} else {
|
|
6290
|
-
|
|
6354
|
+
let asserterNames = Object.getOwnPropertyNames(ctx);
|
|
6291
6355
|
asserterNames.forEach(function(asserterName) {
|
|
6292
6356
|
if (excludeNames.indexOf(asserterName) !== -1) {
|
|
6293
6357
|
return;
|
|
6294
6358
|
}
|
|
6295
|
-
|
|
6359
|
+
let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
|
6296
6360
|
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
|
6297
6361
|
});
|
|
6298
6362
|
}
|
|
@@ -6305,24 +6369,24 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
6305
6369
|
__name(addChainableMethod, "addChainableMethod");
|
|
6306
6370
|
__name2(addChainableMethod, "addChainableMethod");
|
|
6307
6371
|
function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
|
6308
|
-
|
|
6309
|
-
|
|
6372
|
+
let chainableBehavior = ctx.__methods[name];
|
|
6373
|
+
let _chainingBehavior = chainableBehavior.chainingBehavior;
|
|
6310
6374
|
chainableBehavior.chainingBehavior = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function overwritingChainableMethodGetter() {
|
|
6311
|
-
|
|
6375
|
+
let result = chainingBehavior(_chainingBehavior).call(this);
|
|
6312
6376
|
if (result !== void 0) {
|
|
6313
6377
|
return result;
|
|
6314
6378
|
}
|
|
6315
|
-
|
|
6379
|
+
let newAssertion = new Assertion();
|
|
6316
6380
|
transferFlags(this, newAssertion);
|
|
6317
6381
|
return newAssertion;
|
|
6318
6382
|
}, "overwritingChainableMethodGetter"), "overwritingChainableMethodGetter");
|
|
6319
|
-
|
|
6383
|
+
let _method = chainableBehavior.method;
|
|
6320
6384
|
chainableBehavior.method = /* @__PURE__ */ __name2(/* @__PURE__ */ __name(function overwritingChainableMethodWrapper() {
|
|
6321
|
-
|
|
6385
|
+
let result = method(_method).apply(this, arguments);
|
|
6322
6386
|
if (result !== void 0) {
|
|
6323
6387
|
return result;
|
|
6324
6388
|
}
|
|
6325
|
-
|
|
6389
|
+
let newAssertion = new Assertion();
|
|
6326
6390
|
transferFlags(this, newAssertion);
|
|
6327
6391
|
return newAssertion;
|
|
6328
6392
|
}, "overwritingChainableMethodWrapper"), "overwritingChainableMethodWrapper");
|
|
@@ -6349,8 +6413,8 @@ __name(getOwnEnumerableProperties, "getOwnEnumerableProperties");
|
|
|
6349
6413
|
__name2(getOwnEnumerableProperties, "getOwnEnumerableProperties");
|
|
6350
6414
|
var isNaN22 = Number.isNaN;
|
|
6351
6415
|
function isObjectType(obj) {
|
|
6352
|
-
|
|
6353
|
-
|
|
6416
|
+
let objectType = type(obj);
|
|
6417
|
+
let objectTypes = [
|
|
6354
6418
|
"Array",
|
|
6355
6419
|
"Object",
|
|
6356
6420
|
"Function"
|
|
@@ -6360,10 +6424,10 @@ function isObjectType(obj) {
|
|
|
6360
6424
|
__name(isObjectType, "isObjectType");
|
|
6361
6425
|
__name2(isObjectType, "isObjectType");
|
|
6362
6426
|
function getOperator(obj, args) {
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6427
|
+
let operator = flag(obj, "operator");
|
|
6428
|
+
let negate = flag(obj, "negate");
|
|
6429
|
+
let expected = args[3];
|
|
6430
|
+
let msg = negate ? args[2] : args[1];
|
|
6367
6431
|
if (operator) {
|
|
6368
6432
|
return operator;
|
|
6369
6433
|
}
|
|
@@ -6375,7 +6439,7 @@ function getOperator(obj, args) {
|
|
|
6375
6439
|
if (/\shave\s/.test(msg)) {
|
|
6376
6440
|
return void 0;
|
|
6377
6441
|
}
|
|
6378
|
-
|
|
6442
|
+
let isObject2 = isObjectType(expected);
|
|
6379
6443
|
if (/\snot\s/.test(msg)) {
|
|
6380
6444
|
return isObject2 ? "notDeepStrictEqual" : "notStrictEqual";
|
|
6381
6445
|
}
|
|
@@ -6468,7 +6532,7 @@ var functionTypes = {
|
|
|
6468
6532
|
function an(type3, msg) {
|
|
6469
6533
|
if (msg) flag2(this, "message", msg);
|
|
6470
6534
|
type3 = type3.toLowerCase();
|
|
6471
|
-
|
|
6535
|
+
let obj = flag2(this, "object"), article = ~[
|
|
6472
6536
|
"a",
|
|
6473
6537
|
"e",
|
|
6474
6538
|
"i",
|
|
@@ -6498,9 +6562,9 @@ __name(includeChainingBehavior, "includeChainingBehavior");
|
|
|
6498
6562
|
__name2(includeChainingBehavior, "includeChainingBehavior");
|
|
6499
6563
|
function include(val, msg) {
|
|
6500
6564
|
if (msg) flag2(this, "message", msg);
|
|
6501
|
-
|
|
6565
|
+
let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), negate = flag2(this, "negate"), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), descriptor = isDeep ? "deep " : "", isEql = isDeep ? flag2(this, "eql") : SameValueZero;
|
|
6502
6566
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
6503
|
-
|
|
6567
|
+
let included = false;
|
|
6504
6568
|
switch (objType) {
|
|
6505
6569
|
case "string":
|
|
6506
6570
|
included = obj.indexOf(val) !== -1;
|
|
@@ -6534,13 +6598,15 @@ function include(val, msg) {
|
|
|
6534
6598
|
included = obj.indexOf(val) !== -1;
|
|
6535
6599
|
}
|
|
6536
6600
|
break;
|
|
6537
|
-
default:
|
|
6601
|
+
default: {
|
|
6538
6602
|
if (val !== Object(val)) {
|
|
6539
6603
|
throw new AssertionError(flagMsg + "the given combination of arguments (" + objType + " and " + type(val).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + type(val).toLowerCase(), void 0, ssfi);
|
|
6540
6604
|
}
|
|
6541
|
-
|
|
6605
|
+
let props = Object.keys(val);
|
|
6606
|
+
let firstErr = null;
|
|
6607
|
+
let numErrs = 0;
|
|
6542
6608
|
props.forEach(function(prop) {
|
|
6543
|
-
|
|
6609
|
+
let propAssertion = new Assertion(obj);
|
|
6544
6610
|
transferFlags(this, propAssertion, true);
|
|
6545
6611
|
flag2(propAssertion, "lockSsfi", true);
|
|
6546
6612
|
if (!negate || props.length === 1) {
|
|
@@ -6561,6 +6627,7 @@ function include(val, msg) {
|
|
|
6561
6627
|
throw firstErr;
|
|
6562
6628
|
}
|
|
6563
6629
|
return;
|
|
6630
|
+
}
|
|
6564
6631
|
}
|
|
6565
6632
|
this.assert(included, "expected #{this} to " + descriptor + "include " + inspect22(val), "expected #{this} to not " + descriptor + "include " + inspect22(val));
|
|
6566
6633
|
}
|
|
@@ -6613,7 +6680,7 @@ Assertion.addProperty("NaN", function() {
|
|
|
6613
6680
|
this.assert(isNaN22(flag2(this, "object")), "expected #{this} to be NaN", "expected #{this} not to be NaN");
|
|
6614
6681
|
});
|
|
6615
6682
|
function assertExist() {
|
|
6616
|
-
|
|
6683
|
+
let val = flag2(this, "object");
|
|
6617
6684
|
this.assert(val !== null && val !== void 0, "expected #{this} to exist", "expected #{this} to not exist");
|
|
6618
6685
|
}
|
|
6619
6686
|
__name(assertExist, "assertExist");
|
|
@@ -6621,7 +6688,7 @@ __name2(assertExist, "assertExist");
|
|
|
6621
6688
|
Assertion.addProperty("exist", assertExist);
|
|
6622
6689
|
Assertion.addProperty("exists", assertExist);
|
|
6623
6690
|
Assertion.addProperty("empty", function() {
|
|
6624
|
-
|
|
6691
|
+
let val = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), itemsCount;
|
|
6625
6692
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
6626
6693
|
switch (type(val).toLowerCase()) {
|
|
6627
6694
|
case "array":
|
|
@@ -6635,9 +6702,10 @@ Assertion.addProperty("empty", function() {
|
|
|
6635
6702
|
case "weakmap":
|
|
6636
6703
|
case "weakset":
|
|
6637
6704
|
throw new AssertionError(flagMsg + ".empty was passed a weak collection", void 0, ssfi);
|
|
6638
|
-
case "function":
|
|
6639
|
-
|
|
6705
|
+
case "function": {
|
|
6706
|
+
const msg = flagMsg + ".empty was passed a function " + getName(val);
|
|
6640
6707
|
throw new AssertionError(msg.trim(), void 0, ssfi);
|
|
6708
|
+
}
|
|
6641
6709
|
default:
|
|
6642
6710
|
if (val !== Object(val)) {
|
|
6643
6711
|
throw new AssertionError(flagMsg + ".empty was passed non-string primitive " + inspect22(val), void 0, ssfi);
|
|
@@ -6647,7 +6715,7 @@ Assertion.addProperty("empty", function() {
|
|
|
6647
6715
|
this.assert(0 === itemsCount, "expected #{this} to be empty", "expected #{this} not to be empty");
|
|
6648
6716
|
});
|
|
6649
6717
|
function checkArguments() {
|
|
6650
|
-
|
|
6718
|
+
let obj = flag2(this, "object"), type3 = type(obj);
|
|
6651
6719
|
this.assert("Arguments" === type3, "expected #{this} to be arguments but got " + type3, "expected #{this} to not be arguments");
|
|
6652
6720
|
}
|
|
6653
6721
|
__name(checkArguments, "checkArguments");
|
|
@@ -6656,9 +6724,9 @@ Assertion.addProperty("arguments", checkArguments);
|
|
|
6656
6724
|
Assertion.addProperty("Arguments", checkArguments);
|
|
6657
6725
|
function assertEqual(val, msg) {
|
|
6658
6726
|
if (msg) flag2(this, "message", msg);
|
|
6659
|
-
|
|
6727
|
+
let obj = flag2(this, "object");
|
|
6660
6728
|
if (flag2(this, "deep")) {
|
|
6661
|
-
|
|
6729
|
+
let prevLockSsfi = flag2(this, "lockSsfi");
|
|
6662
6730
|
flag2(this, "lockSsfi", true);
|
|
6663
6731
|
this.eql(val);
|
|
6664
6732
|
flag2(this, "lockSsfi", prevLockSsfi);
|
|
@@ -6673,7 +6741,7 @@ Assertion.addMethod("equals", assertEqual);
|
|
|
6673
6741
|
Assertion.addMethod("eq", assertEqual);
|
|
6674
6742
|
function assertEql(obj, msg) {
|
|
6675
6743
|
if (msg) flag2(this, "message", msg);
|
|
6676
|
-
|
|
6744
|
+
let eql = flag2(this, "eql");
|
|
6677
6745
|
this.assert(eql(obj, flag2(this, "object")), "expected #{this} to deeply equal #{exp}", "expected #{this} to not deeply equal #{exp}", obj, this._obj, true);
|
|
6678
6746
|
}
|
|
6679
6747
|
__name(assertEql, "assertEql");
|
|
@@ -6682,7 +6750,7 @@ Assertion.addMethod("eql", assertEql);
|
|
|
6682
6750
|
Assertion.addMethod("eqls", assertEql);
|
|
6683
6751
|
function assertAbove(n, msg) {
|
|
6684
6752
|
if (msg) flag2(this, "message", msg);
|
|
6685
|
-
|
|
6753
|
+
let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase();
|
|
6686
6754
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
6687
6755
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
6688
6756
|
}
|
|
@@ -6691,11 +6759,11 @@ function assertAbove(n, msg) {
|
|
|
6691
6759
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
6692
6760
|
throw new AssertionError(msgPrefix + "the argument to above must be a number", void 0, ssfi);
|
|
6693
6761
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
6694
|
-
|
|
6762
|
+
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
6695
6763
|
throw new AssertionError(msgPrefix + "expected " + printObj + " to be a number or a date", void 0, ssfi);
|
|
6696
6764
|
}
|
|
6697
6765
|
if (doLength) {
|
|
6698
|
-
|
|
6766
|
+
let descriptor = "length", itemsCount;
|
|
6699
6767
|
if (objType === "map" || objType === "set") {
|
|
6700
6768
|
descriptor = "size";
|
|
6701
6769
|
itemsCount = obj.size;
|
|
@@ -6714,7 +6782,7 @@ Assertion.addMethod("gt", assertAbove);
|
|
|
6714
6782
|
Assertion.addMethod("greaterThan", assertAbove);
|
|
6715
6783
|
function assertLeast(n, msg) {
|
|
6716
6784
|
if (msg) flag2(this, "message", msg);
|
|
6717
|
-
|
|
6785
|
+
let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
6718
6786
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
6719
6787
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
6720
6788
|
}
|
|
@@ -6723,7 +6791,7 @@ function assertLeast(n, msg) {
|
|
|
6723
6791
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
6724
6792
|
errorMessage = msgPrefix + "the argument to least must be a number";
|
|
6725
6793
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
6726
|
-
|
|
6794
|
+
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
6727
6795
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
6728
6796
|
} else {
|
|
6729
6797
|
shouldThrow = false;
|
|
@@ -6732,7 +6800,7 @@ function assertLeast(n, msg) {
|
|
|
6732
6800
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
6733
6801
|
}
|
|
6734
6802
|
if (doLength) {
|
|
6735
|
-
|
|
6803
|
+
let descriptor = "length", itemsCount;
|
|
6736
6804
|
if (objType === "map" || objType === "set") {
|
|
6737
6805
|
descriptor = "size";
|
|
6738
6806
|
itemsCount = obj.size;
|
|
@@ -6751,7 +6819,7 @@ Assertion.addMethod("gte", assertLeast);
|
|
|
6751
6819
|
Assertion.addMethod("greaterThanOrEqual", assertLeast);
|
|
6752
6820
|
function assertBelow(n, msg) {
|
|
6753
6821
|
if (msg) flag2(this, "message", msg);
|
|
6754
|
-
|
|
6822
|
+
let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
6755
6823
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
6756
6824
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
6757
6825
|
}
|
|
@@ -6760,7 +6828,7 @@ function assertBelow(n, msg) {
|
|
|
6760
6828
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
6761
6829
|
errorMessage = msgPrefix + "the argument to below must be a number";
|
|
6762
6830
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
6763
|
-
|
|
6831
|
+
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
6764
6832
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
6765
6833
|
} else {
|
|
6766
6834
|
shouldThrow = false;
|
|
@@ -6769,7 +6837,7 @@ function assertBelow(n, msg) {
|
|
|
6769
6837
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
6770
6838
|
}
|
|
6771
6839
|
if (doLength) {
|
|
6772
|
-
|
|
6840
|
+
let descriptor = "length", itemsCount;
|
|
6773
6841
|
if (objType === "map" || objType === "set") {
|
|
6774
6842
|
descriptor = "size";
|
|
6775
6843
|
itemsCount = obj.size;
|
|
@@ -6788,7 +6856,7 @@ Assertion.addMethod("lt", assertBelow);
|
|
|
6788
6856
|
Assertion.addMethod("lessThan", assertBelow);
|
|
6789
6857
|
function assertMost(n, msg) {
|
|
6790
6858
|
if (msg) flag2(this, "message", msg);
|
|
6791
|
-
|
|
6859
|
+
let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true;
|
|
6792
6860
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
6793
6861
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
6794
6862
|
}
|
|
@@ -6797,7 +6865,7 @@ function assertMost(n, msg) {
|
|
|
6797
6865
|
} else if (!isNumeric(n) && (doLength || isNumeric(obj))) {
|
|
6798
6866
|
errorMessage = msgPrefix + "the argument to most must be a number";
|
|
6799
6867
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
6800
|
-
|
|
6868
|
+
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
6801
6869
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
6802
6870
|
} else {
|
|
6803
6871
|
shouldThrow = false;
|
|
@@ -6806,7 +6874,7 @@ function assertMost(n, msg) {
|
|
|
6806
6874
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
6807
6875
|
}
|
|
6808
6876
|
if (doLength) {
|
|
6809
|
-
|
|
6877
|
+
let descriptor = "length", itemsCount;
|
|
6810
6878
|
if (objType === "map" || objType === "set") {
|
|
6811
6879
|
descriptor = "size";
|
|
6812
6880
|
itemsCount = obj.size;
|
|
@@ -6825,7 +6893,7 @@ Assertion.addMethod("lte", assertMost);
|
|
|
6825
6893
|
Assertion.addMethod("lessThanOrEqual", assertMost);
|
|
6826
6894
|
Assertion.addMethod("within", function(start, finish, msg) {
|
|
6827
6895
|
if (msg) flag2(this, "message", msg);
|
|
6828
|
-
|
|
6896
|
+
let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), startType = type(start).toLowerCase(), finishType = type(finish).toLowerCase(), errorMessage, shouldThrow = true, range = startType === "date" && finishType === "date" ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish;
|
|
6829
6897
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
6830
6898
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
6831
6899
|
}
|
|
@@ -6834,7 +6902,7 @@ Assertion.addMethod("within", function(start, finish, msg) {
|
|
|
6834
6902
|
} else if ((!isNumeric(start) || !isNumeric(finish)) && (doLength || isNumeric(obj))) {
|
|
6835
6903
|
errorMessage = msgPrefix + "the arguments to within must be numbers";
|
|
6836
6904
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
6837
|
-
|
|
6905
|
+
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
6838
6906
|
errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date";
|
|
6839
6907
|
} else {
|
|
6840
6908
|
shouldThrow = false;
|
|
@@ -6843,7 +6911,7 @@ Assertion.addMethod("within", function(start, finish, msg) {
|
|
|
6843
6911
|
throw new AssertionError(errorMessage, void 0, ssfi);
|
|
6844
6912
|
}
|
|
6845
6913
|
if (doLength) {
|
|
6846
|
-
|
|
6914
|
+
let descriptor = "length", itemsCount;
|
|
6847
6915
|
if (objType === "map" || objType === "set") {
|
|
6848
6916
|
descriptor = "size";
|
|
6849
6917
|
itemsCount = obj.size;
|
|
@@ -6857,11 +6925,12 @@ Assertion.addMethod("within", function(start, finish, msg) {
|
|
|
6857
6925
|
});
|
|
6858
6926
|
function assertInstanceOf(constructor, msg) {
|
|
6859
6927
|
if (msg) flag2(this, "message", msg);
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6928
|
+
let target = flag2(this, "object");
|
|
6929
|
+
let ssfi = flag2(this, "ssfi");
|
|
6930
|
+
let flagMsg = flag2(this, "message");
|
|
6931
|
+
let isInstanceOf;
|
|
6863
6932
|
try {
|
|
6864
|
-
|
|
6933
|
+
isInstanceOf = target instanceof constructor;
|
|
6865
6934
|
} catch (err) {
|
|
6866
6935
|
if (err instanceof TypeError) {
|
|
6867
6936
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
@@ -6869,7 +6938,7 @@ function assertInstanceOf(constructor, msg) {
|
|
|
6869
6938
|
}
|
|
6870
6939
|
throw err;
|
|
6871
6940
|
}
|
|
6872
|
-
|
|
6941
|
+
let name = getName(constructor);
|
|
6873
6942
|
if (name == null) {
|
|
6874
6943
|
name = "an unnamed constructor";
|
|
6875
6944
|
}
|
|
@@ -6881,7 +6950,7 @@ Assertion.addMethod("instanceof", assertInstanceOf);
|
|
|
6881
6950
|
Assertion.addMethod("instanceOf", assertInstanceOf);
|
|
6882
6951
|
function assertProperty(name, val, msg) {
|
|
6883
6952
|
if (msg) flag2(this, "message", msg);
|
|
6884
|
-
|
|
6953
|
+
let isNested = flag2(this, "nested"), isOwn = flag2(this, "own"), flagMsg = flag2(this, "message"), obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), nameType = typeof name;
|
|
6885
6954
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
6886
6955
|
if (isNested) {
|
|
6887
6956
|
if (nameType !== "string") {
|
|
@@ -6898,13 +6967,13 @@ function assertProperty(name, val, msg) {
|
|
|
6898
6967
|
if (obj === null || obj === void 0) {
|
|
6899
6968
|
throw new AssertionError(flagMsg + "Target cannot be null or undefined.", void 0, ssfi);
|
|
6900
6969
|
}
|
|
6901
|
-
|
|
6902
|
-
|
|
6970
|
+
let isDeep = flag2(this, "deep"), negate = flag2(this, "negate"), pathInfo = isNested ? getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name], isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
|
|
6971
|
+
let descriptor = "";
|
|
6903
6972
|
if (isDeep) descriptor += "deep ";
|
|
6904
6973
|
if (isOwn) descriptor += "own ";
|
|
6905
6974
|
if (isNested) descriptor += "nested ";
|
|
6906
6975
|
descriptor += "property ";
|
|
6907
|
-
|
|
6976
|
+
let hasProperty2;
|
|
6908
6977
|
if (isOwn) hasProperty2 = Object.prototype.hasOwnProperty.call(obj, name);
|
|
6909
6978
|
else if (isNested) hasProperty2 = pathInfo.exists;
|
|
6910
6979
|
else hasProperty2 = hasProperty(obj, name);
|
|
@@ -6933,9 +7002,9 @@ function assertOwnPropertyDescriptor(name, descriptor, msg) {
|
|
|
6933
7002
|
descriptor = null;
|
|
6934
7003
|
}
|
|
6935
7004
|
if (msg) flag2(this, "message", msg);
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
7005
|
+
let obj = flag2(this, "object");
|
|
7006
|
+
let actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
|
|
7007
|
+
let eql = flag2(this, "eql");
|
|
6939
7008
|
if (actualDescriptor && descriptor) {
|
|
6940
7009
|
this.assert(eql(descriptor, actualDescriptor), "expected the own property descriptor for " + inspect22(name) + " on #{this} to match " + inspect22(descriptor) + ", got " + inspect22(actualDescriptor), "expected the own property descriptor for " + inspect22(name) + " on #{this} to not match " + inspect22(descriptor), descriptor, actualDescriptor, true);
|
|
6941
7010
|
} else {
|
|
@@ -6954,7 +7023,7 @@ __name(assertLengthChain, "assertLengthChain");
|
|
|
6954
7023
|
__name2(assertLengthChain, "assertLengthChain");
|
|
6955
7024
|
function assertLength(n, msg) {
|
|
6956
7025
|
if (msg) flag2(this, "message", msg);
|
|
6957
|
-
|
|
7026
|
+
let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), descriptor = "length", itemsCount;
|
|
6958
7027
|
switch (objType) {
|
|
6959
7028
|
case "map":
|
|
6960
7029
|
case "set":
|
|
@@ -6973,7 +7042,7 @@ Assertion.addChainableMethod("length", assertLength, assertLengthChain);
|
|
|
6973
7042
|
Assertion.addChainableMethod("lengthOf", assertLength, assertLengthChain);
|
|
6974
7043
|
function assertMatch(re, msg) {
|
|
6975
7044
|
if (msg) flag2(this, "message", msg);
|
|
6976
|
-
|
|
7045
|
+
let obj = flag2(this, "object");
|
|
6977
7046
|
this.assert(re.exec(obj), "expected #{this} to match " + re, "expected #{this} not to match " + re);
|
|
6978
7047
|
}
|
|
6979
7048
|
__name(assertMatch, "assertMatch");
|
|
@@ -6982,14 +7051,14 @@ Assertion.addMethod("match", assertMatch);
|
|
|
6982
7051
|
Assertion.addMethod("matches", assertMatch);
|
|
6983
7052
|
Assertion.addMethod("string", function(str, msg) {
|
|
6984
7053
|
if (msg) flag2(this, "message", msg);
|
|
6985
|
-
|
|
7054
|
+
let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
6986
7055
|
new Assertion(obj, flagMsg, ssfi, true).is.a("string");
|
|
6987
7056
|
this.assert(~obj.indexOf(str), "expected #{this} to contain " + inspect22(str), "expected #{this} to not contain " + inspect22(str));
|
|
6988
7057
|
});
|
|
6989
7058
|
function assertKeys(keys) {
|
|
6990
|
-
|
|
7059
|
+
let obj = flag2(this, "object"), objType = type(obj), keysType = type(keys), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = flag2(this, "message");
|
|
6991
7060
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
6992
|
-
|
|
7061
|
+
let mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments";
|
|
6993
7062
|
if (objType === "Map" || objType === "Set") {
|
|
6994
7063
|
deepStr = isDeep ? "deeply " : "";
|
|
6995
7064
|
actual = [];
|
|
@@ -7023,7 +7092,7 @@ function assertKeys(keys) {
|
|
|
7023
7092
|
if (!keys.length) {
|
|
7024
7093
|
throw new AssertionError(flagMsg + "keys required", void 0, ssfi);
|
|
7025
7094
|
}
|
|
7026
|
-
|
|
7095
|
+
let len = keys.length, any = flag2(this, "any"), all = flag2(this, "all"), expected = keys, isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2;
|
|
7027
7096
|
if (!any && !all) {
|
|
7028
7097
|
all = true;
|
|
7029
7098
|
}
|
|
@@ -7048,7 +7117,7 @@ function assertKeys(keys) {
|
|
|
7048
7117
|
keys = keys.map(function(key) {
|
|
7049
7118
|
return inspect22(key);
|
|
7050
7119
|
});
|
|
7051
|
-
|
|
7120
|
+
let last = keys.pop();
|
|
7052
7121
|
if (all) {
|
|
7053
7122
|
str = keys.join(", ") + ", and " + last;
|
|
7054
7123
|
}
|
|
@@ -7068,7 +7137,7 @@ Assertion.addMethod("keys", assertKeys);
|
|
|
7068
7137
|
Assertion.addMethod("key", assertKeys);
|
|
7069
7138
|
function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
7070
7139
|
if (msg) flag2(this, "message", msg);
|
|
7071
|
-
|
|
7140
|
+
let obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), negate = flag2(this, "negate") || false;
|
|
7072
7141
|
new Assertion(obj, flagMsg, ssfi, true).is.a("function");
|
|
7073
7142
|
if (isRegExp2(errorLike) || typeof errorLike === "string") {
|
|
7074
7143
|
errMsgMatcher = errorLike;
|
|
@@ -7082,12 +7151,12 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7082
7151
|
errorWasThrown = true;
|
|
7083
7152
|
caughtErr = err;
|
|
7084
7153
|
}
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7154
|
+
let everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0;
|
|
7155
|
+
let everyArgIsDefined = Boolean(errorLike && errMsgMatcher);
|
|
7156
|
+
let errorLikeFail = false;
|
|
7157
|
+
let errMsgMatcherFail = false;
|
|
7089
7158
|
if (everyArgIsUndefined || !everyArgIsUndefined && !negate) {
|
|
7090
|
-
|
|
7159
|
+
let errorLikeString = "an error";
|
|
7091
7160
|
if (errorLike instanceof Error) {
|
|
7092
7161
|
errorLikeString = "#{exp}";
|
|
7093
7162
|
} else if (errorLike) {
|
|
@@ -7108,7 +7177,7 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7108
7177
|
}
|
|
7109
7178
|
if (errorLike && caughtErr) {
|
|
7110
7179
|
if (errorLike instanceof Error) {
|
|
7111
|
-
|
|
7180
|
+
let isCompatibleInstance = check_error_exports.compatibleInstance(caughtErr, errorLike);
|
|
7112
7181
|
if (isCompatibleInstance === negate) {
|
|
7113
7182
|
if (everyArgIsDefined && negate) {
|
|
7114
7183
|
errorLikeFail = true;
|
|
@@ -7117,7 +7186,7 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7117
7186
|
}
|
|
7118
7187
|
}
|
|
7119
7188
|
}
|
|
7120
|
-
|
|
7189
|
+
let isCompatibleConstructor = check_error_exports.compatibleConstructor(caughtErr, errorLike);
|
|
7121
7190
|
if (isCompatibleConstructor === negate) {
|
|
7122
7191
|
if (everyArgIsDefined && negate) {
|
|
7123
7192
|
errorLikeFail = true;
|
|
@@ -7127,11 +7196,11 @@ function assertThrows(errorLike, errMsgMatcher, msg) {
|
|
|
7127
7196
|
}
|
|
7128
7197
|
}
|
|
7129
7198
|
if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) {
|
|
7130
|
-
|
|
7199
|
+
let placeholder = "including";
|
|
7131
7200
|
if (isRegExp2(errMsgMatcher)) {
|
|
7132
7201
|
placeholder = "matching";
|
|
7133
7202
|
}
|
|
7134
|
-
|
|
7203
|
+
let isCompatibleMessage = check_error_exports.compatibleMessage(caughtErr, errMsgMatcher);
|
|
7135
7204
|
if (isCompatibleMessage === negate) {
|
|
7136
7205
|
if (everyArgIsDefined && negate) {
|
|
7137
7206
|
errMsgMatcherFail = true;
|
|
@@ -7152,7 +7221,7 @@ Assertion.addMethod("throws", assertThrows);
|
|
|
7152
7221
|
Assertion.addMethod("Throw", assertThrows);
|
|
7153
7222
|
function respondTo(method, msg) {
|
|
7154
7223
|
if (msg) flag2(this, "message", msg);
|
|
7155
|
-
|
|
7224
|
+
let obj = flag2(this, "object"), itself = flag2(this, "itself"), context = "function" === typeof obj && !itself ? obj.prototype[method] : obj[method];
|
|
7156
7225
|
this.assert("function" === typeof context, "expected #{this} to respond to " + inspect22(method), "expected #{this} to not respond to " + inspect22(method));
|
|
7157
7226
|
}
|
|
7158
7227
|
__name(respondTo, "respondTo");
|
|
@@ -7164,8 +7233,8 @@ Assertion.addProperty("itself", function() {
|
|
|
7164
7233
|
});
|
|
7165
7234
|
function satisfy(matcher, msg) {
|
|
7166
7235
|
if (msg) flag2(this, "message", msg);
|
|
7167
|
-
|
|
7168
|
-
|
|
7236
|
+
let obj = flag2(this, "object");
|
|
7237
|
+
let result = matcher(obj);
|
|
7169
7238
|
this.assert(result, "expected #{this} to satisfy " + objDisplay2(matcher), "expected #{this} to not satisfy" + objDisplay2(matcher), flag2(this, "negate") ? false : true, result);
|
|
7170
7239
|
}
|
|
7171
7240
|
__name(satisfy, "satisfy");
|
|
@@ -7174,13 +7243,17 @@ Assertion.addMethod("satisfy", satisfy);
|
|
|
7174
7243
|
Assertion.addMethod("satisfies", satisfy);
|
|
7175
7244
|
function closeTo(expected, delta, msg) {
|
|
7176
7245
|
if (msg) flag2(this, "message", msg);
|
|
7177
|
-
|
|
7246
|
+
let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7178
7247
|
new Assertion(obj, flagMsg, ssfi, true).is.numeric;
|
|
7179
7248
|
let message = "A `delta` value is required for `closeTo`";
|
|
7180
|
-
if (delta == void 0)
|
|
7249
|
+
if (delta == void 0) {
|
|
7250
|
+
throw new AssertionError(flagMsg ? `${flagMsg}: ${message}` : message, void 0, ssfi);
|
|
7251
|
+
}
|
|
7181
7252
|
new Assertion(delta, flagMsg, ssfi, true).is.numeric;
|
|
7182
7253
|
message = "A `expected` value is required for `closeTo`";
|
|
7183
|
-
if (expected == void 0)
|
|
7254
|
+
if (expected == void 0) {
|
|
7255
|
+
throw new AssertionError(flagMsg ? `${flagMsg}: ${message}` : message, void 0, ssfi);
|
|
7256
|
+
}
|
|
7184
7257
|
new Assertion(expected, flagMsg, ssfi, true).is.numeric;
|
|
7185
7258
|
const abs = /* @__PURE__ */ __name2((x) => x < 0n ? -x : x, "abs");
|
|
7186
7259
|
const strip = /* @__PURE__ */ __name2((number) => parseFloat(parseFloat(number).toPrecision(12)), "strip");
|
|
@@ -7200,14 +7273,14 @@ function isSubsetOf(_subset, _superset, cmp, contains, ordered) {
|
|
|
7200
7273
|
return subset.every(function(elem, idx) {
|
|
7201
7274
|
if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx];
|
|
7202
7275
|
if (!cmp) {
|
|
7203
|
-
|
|
7276
|
+
let matchIdx = superset.indexOf(elem);
|
|
7204
7277
|
if (matchIdx === -1) return false;
|
|
7205
7278
|
if (!contains) superset.splice(matchIdx, 1);
|
|
7206
7279
|
return true;
|
|
7207
7280
|
}
|
|
7208
|
-
return superset.some(function(elem2,
|
|
7281
|
+
return superset.some(function(elem2, matchIdx) {
|
|
7209
7282
|
if (!cmp(elem, elem2)) return false;
|
|
7210
|
-
if (!contains) superset.splice(
|
|
7283
|
+
if (!contains) superset.splice(matchIdx, 1);
|
|
7211
7284
|
return true;
|
|
7212
7285
|
});
|
|
7213
7286
|
});
|
|
@@ -7216,12 +7289,12 @@ __name(isSubsetOf, "isSubsetOf");
|
|
|
7216
7289
|
__name2(isSubsetOf, "isSubsetOf");
|
|
7217
7290
|
Assertion.addMethod("members", function(subset, msg) {
|
|
7218
7291
|
if (msg) flag2(this, "message", msg);
|
|
7219
|
-
|
|
7292
|
+
let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7220
7293
|
new Assertion(obj, flagMsg, ssfi, true).to.be.iterable;
|
|
7221
7294
|
new Assertion(subset, flagMsg, ssfi, true).to.be.iterable;
|
|
7222
|
-
|
|
7223
|
-
|
|
7224
|
-
|
|
7295
|
+
let contains = flag2(this, "contains");
|
|
7296
|
+
let ordered = flag2(this, "ordered");
|
|
7297
|
+
let subject, failMsg, failNegateMsg;
|
|
7225
7298
|
if (contains) {
|
|
7226
7299
|
subject = ordered ? "an ordered superset" : "a superset";
|
|
7227
7300
|
failMsg = "expected #{this} to be " + subject + " of #{exp}";
|
|
@@ -7231,17 +7304,17 @@ Assertion.addMethod("members", function(subset, msg) {
|
|
|
7231
7304
|
failMsg = "expected #{this} to have the same " + subject + " as #{exp}";
|
|
7232
7305
|
failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}";
|
|
7233
7306
|
}
|
|
7234
|
-
|
|
7307
|
+
let cmp = flag2(this, "deep") ? flag2(this, "eql") : void 0;
|
|
7235
7308
|
this.assert(isSubsetOf(subset, obj, cmp, contains, ordered), failMsg, failNegateMsg, subset, obj, true);
|
|
7236
7309
|
});
|
|
7237
7310
|
Assertion.addProperty("iterable", function(msg) {
|
|
7238
7311
|
if (msg) flag2(this, "message", msg);
|
|
7239
|
-
|
|
7312
|
+
let obj = flag2(this, "object");
|
|
7240
7313
|
this.assert(obj != void 0 && obj[Symbol.iterator], "expected #{this} to be an iterable", "expected #{this} to not be an iterable", obj);
|
|
7241
7314
|
});
|
|
7242
7315
|
function oneOf(list, msg) {
|
|
7243
7316
|
if (msg) flag2(this, "message", msg);
|
|
7244
|
-
|
|
7317
|
+
let expected = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), contains = flag2(this, "contains"), isDeep = flag2(this, "deep"), eql = flag2(this, "eql");
|
|
7245
7318
|
new Assertion(list, flagMsg, ssfi, true).to.be.an("array");
|
|
7246
7319
|
if (contains) {
|
|
7247
7320
|
this.assert(list.some(function(possibility) {
|
|
@@ -7262,9 +7335,9 @@ __name2(oneOf, "oneOf");
|
|
|
7262
7335
|
Assertion.addMethod("oneOf", oneOf);
|
|
7263
7336
|
function assertChanges(subject, prop, msg) {
|
|
7264
7337
|
if (msg) flag2(this, "message", msg);
|
|
7265
|
-
|
|
7338
|
+
let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7266
7339
|
new Assertion(fn, flagMsg, ssfi, true).is.a("function");
|
|
7267
|
-
|
|
7340
|
+
let initial;
|
|
7268
7341
|
if (!prop) {
|
|
7269
7342
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
7270
7343
|
initial = subject();
|
|
@@ -7273,8 +7346,8 @@ function assertChanges(subject, prop, msg) {
|
|
|
7273
7346
|
initial = subject[prop];
|
|
7274
7347
|
}
|
|
7275
7348
|
fn();
|
|
7276
|
-
|
|
7277
|
-
|
|
7349
|
+
let final = prop === void 0 || prop === null ? subject() : subject[prop];
|
|
7350
|
+
let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
7278
7351
|
flag2(this, "deltaMsgObj", msgObj);
|
|
7279
7352
|
flag2(this, "initialDeltaValue", initial);
|
|
7280
7353
|
flag2(this, "finalDeltaValue", final);
|
|
@@ -7288,9 +7361,9 @@ Assertion.addMethod("change", assertChanges);
|
|
|
7288
7361
|
Assertion.addMethod("changes", assertChanges);
|
|
7289
7362
|
function assertIncreases(subject, prop, msg) {
|
|
7290
7363
|
if (msg) flag2(this, "message", msg);
|
|
7291
|
-
|
|
7364
|
+
let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7292
7365
|
new Assertion(fn, flagMsg, ssfi, true).is.a("function");
|
|
7293
|
-
|
|
7366
|
+
let initial;
|
|
7294
7367
|
if (!prop) {
|
|
7295
7368
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
7296
7369
|
initial = subject();
|
|
@@ -7300,8 +7373,8 @@ function assertIncreases(subject, prop, msg) {
|
|
|
7300
7373
|
}
|
|
7301
7374
|
new Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
7302
7375
|
fn();
|
|
7303
|
-
|
|
7304
|
-
|
|
7376
|
+
let final = prop === void 0 || prop === null ? subject() : subject[prop];
|
|
7377
|
+
let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
7305
7378
|
flag2(this, "deltaMsgObj", msgObj);
|
|
7306
7379
|
flag2(this, "initialDeltaValue", initial);
|
|
7307
7380
|
flag2(this, "finalDeltaValue", final);
|
|
@@ -7315,9 +7388,9 @@ Assertion.addMethod("increase", assertIncreases);
|
|
|
7315
7388
|
Assertion.addMethod("increases", assertIncreases);
|
|
7316
7389
|
function assertDecreases(subject, prop, msg) {
|
|
7317
7390
|
if (msg) flag2(this, "message", msg);
|
|
7318
|
-
|
|
7391
|
+
let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi");
|
|
7319
7392
|
new Assertion(fn, flagMsg, ssfi, true).is.a("function");
|
|
7320
|
-
|
|
7393
|
+
let initial;
|
|
7321
7394
|
if (!prop) {
|
|
7322
7395
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
7323
7396
|
initial = subject();
|
|
@@ -7327,8 +7400,8 @@ function assertDecreases(subject, prop, msg) {
|
|
|
7327
7400
|
}
|
|
7328
7401
|
new Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
7329
7402
|
fn();
|
|
7330
|
-
|
|
7331
|
-
|
|
7403
|
+
let final = prop === void 0 || prop === null ? subject() : subject[prop];
|
|
7404
|
+
let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
7332
7405
|
flag2(this, "deltaMsgObj", msgObj);
|
|
7333
7406
|
flag2(this, "initialDeltaValue", initial);
|
|
7334
7407
|
flag2(this, "finalDeltaValue", final);
|
|
@@ -7342,12 +7415,12 @@ Assertion.addMethod("decrease", assertDecreases);
|
|
|
7342
7415
|
Assertion.addMethod("decreases", assertDecreases);
|
|
7343
7416
|
function assertDelta(delta, msg) {
|
|
7344
7417
|
if (msg) flag2(this, "message", msg);
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7418
|
+
let msgObj = flag2(this, "deltaMsgObj");
|
|
7419
|
+
let initial = flag2(this, "initialDeltaValue");
|
|
7420
|
+
let final = flag2(this, "finalDeltaValue");
|
|
7421
|
+
let behavior = flag2(this, "deltaBehavior");
|
|
7422
|
+
let realDelta = flag2(this, "realDelta");
|
|
7423
|
+
let expression;
|
|
7351
7424
|
if (behavior === "change") {
|
|
7352
7425
|
expression = Math.abs(final - initial) === Math.abs(delta);
|
|
7353
7426
|
} else {
|
|
@@ -7359,22 +7432,22 @@ __name(assertDelta, "assertDelta");
|
|
|
7359
7432
|
__name2(assertDelta, "assertDelta");
|
|
7360
7433
|
Assertion.addMethod("by", assertDelta);
|
|
7361
7434
|
Assertion.addProperty("extensible", function() {
|
|
7362
|
-
|
|
7363
|
-
|
|
7435
|
+
let obj = flag2(this, "object");
|
|
7436
|
+
let isExtensible = obj === Object(obj) && Object.isExtensible(obj);
|
|
7364
7437
|
this.assert(isExtensible, "expected #{this} to be extensible", "expected #{this} to not be extensible");
|
|
7365
7438
|
});
|
|
7366
7439
|
Assertion.addProperty("sealed", function() {
|
|
7367
|
-
|
|
7368
|
-
|
|
7440
|
+
let obj = flag2(this, "object");
|
|
7441
|
+
let isSealed = obj === Object(obj) ? Object.isSealed(obj) : true;
|
|
7369
7442
|
this.assert(isSealed, "expected #{this} to be sealed", "expected #{this} to not be sealed");
|
|
7370
7443
|
});
|
|
7371
7444
|
Assertion.addProperty("frozen", function() {
|
|
7372
|
-
|
|
7373
|
-
|
|
7445
|
+
let obj = flag2(this, "object");
|
|
7446
|
+
let isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true;
|
|
7374
7447
|
this.assert(isFrozen, "expected #{this} to be frozen", "expected #{this} to not be frozen");
|
|
7375
7448
|
});
|
|
7376
7449
|
Assertion.addProperty("finite", function(_msg) {
|
|
7377
|
-
|
|
7450
|
+
let obj = flag2(this, "object");
|
|
7378
7451
|
this.assert(typeof obj === "number" && isFinite(obj), "expected #{this} to be a finite number", "expected #{this} to not be a finite number");
|
|
7379
7452
|
});
|
|
7380
7453
|
function compareSubset(expected, actual) {
|
|
@@ -7408,8 +7481,8 @@ function compareSubset(expected, actual) {
|
|
|
7408
7481
|
}
|
|
7409
7482
|
}
|
|
7410
7483
|
return Object.keys(expected).every(function(key) {
|
|
7411
|
-
|
|
7412
|
-
|
|
7484
|
+
let expectedValue = expected[key];
|
|
7485
|
+
let actualValue = actual[key];
|
|
7413
7486
|
if (typeof expectedValue === "object" && expectedValue !== null && actualValue !== null) {
|
|
7414
7487
|
return compareSubset(expectedValue, actualValue);
|
|
7415
7488
|
}
|
|
@@ -7472,7 +7545,7 @@ function loadShould() {
|
|
|
7472
7545
|
get: shouldGetter,
|
|
7473
7546
|
configurable: true
|
|
7474
7547
|
});
|
|
7475
|
-
|
|
7548
|
+
let should2 = {};
|
|
7476
7549
|
should2.fail = function(actual, expected, message, operator) {
|
|
7477
7550
|
if (arguments.length < 2) {
|
|
7478
7551
|
message = actual;
|
|
@@ -7513,7 +7586,7 @@ __name2(loadShould, "loadShould");
|
|
|
7513
7586
|
var should = loadShould;
|
|
7514
7587
|
var Should = loadShould;
|
|
7515
7588
|
function assert2(express, errmsg) {
|
|
7516
|
-
|
|
7589
|
+
let test22 = new Assertion(null, null, assert2, true);
|
|
7517
7590
|
test22.assert(express, errmsg, "[ negation message unavailable ]");
|
|
7518
7591
|
}
|
|
7519
7592
|
__name(assert2, "assert");
|
|
@@ -7537,11 +7610,11 @@ assert2.isNotOk = function(val, msg) {
|
|
|
7537
7610
|
new Assertion(val, msg, assert2.isNotOk, true).is.not.ok;
|
|
7538
7611
|
};
|
|
7539
7612
|
assert2.equal = function(act, exp, msg) {
|
|
7540
|
-
|
|
7613
|
+
let test22 = new Assertion(act, msg, assert2.equal, true);
|
|
7541
7614
|
test22.assert(exp == flag(test22, "object"), "expected #{this} to equal #{exp}", "expected #{this} to not equal #{act}", exp, act, true);
|
|
7542
7615
|
};
|
|
7543
7616
|
assert2.notEqual = function(act, exp, msg) {
|
|
7544
|
-
|
|
7617
|
+
let test22 = new Assertion(act, msg, assert2.notEqual, true);
|
|
7545
7618
|
test22.assert(exp != flag(test22, "object"), "expected #{this} to not equal #{exp}", "expected #{this} to equal #{act}", exp, act, true);
|
|
7546
7619
|
};
|
|
7547
7620
|
assert2.strictEqual = function(act, exp, msg) {
|
|
@@ -7795,7 +7868,7 @@ assert2.throws = function(fn, errorLike, errMsgMatcher, msg) {
|
|
|
7795
7868
|
errMsgMatcher = errorLike;
|
|
7796
7869
|
errorLike = null;
|
|
7797
7870
|
}
|
|
7798
|
-
|
|
7871
|
+
let assertErr = new Assertion(fn, msg, assert2.throws, true).to.throw(errorLike, errMsgMatcher);
|
|
7799
7872
|
return flag(assertErr, "object");
|
|
7800
7873
|
};
|
|
7801
7874
|
assert2.doesNotThrow = function(fn, errorLike, errMsgMatcher, message) {
|
|
@@ -7806,7 +7879,7 @@ assert2.doesNotThrow = function(fn, errorLike, errMsgMatcher, message) {
|
|
|
7806
7879
|
new Assertion(fn, message, assert2.doesNotThrow, true).to.not.throw(errorLike, errMsgMatcher);
|
|
7807
7880
|
};
|
|
7808
7881
|
assert2.operator = function(val, operator, val2, msg) {
|
|
7809
|
-
|
|
7882
|
+
let ok;
|
|
7810
7883
|
switch (operator) {
|
|
7811
7884
|
case "==":
|
|
7812
7885
|
ok = val == val2;
|
|
@@ -7836,7 +7909,7 @@ assert2.operator = function(val, operator, val2, msg) {
|
|
|
7836
7909
|
msg = msg ? msg + ": " : msg;
|
|
7837
7910
|
throw new AssertionError(msg + 'Invalid operator "' + operator + '"', void 0, assert2.operator);
|
|
7838
7911
|
}
|
|
7839
|
-
|
|
7912
|
+
let test22 = new Assertion(ok, msg, assert2.operator, true);
|
|
7840
7913
|
test22.assert(true === flag(test22, "object"), "expected " + inspect22(val) + " to be " + operator + " " + inspect22(val2), "expected " + inspect22(val) + " to not be " + operator + " " + inspect22(val2));
|
|
7841
7914
|
};
|
|
7842
7915
|
assert2.closeTo = function(act, exp, delta, msg) {
|
|
@@ -7911,7 +7984,7 @@ assert2.changes = function(fn, obj, prop, msg) {
|
|
|
7911
7984
|
};
|
|
7912
7985
|
assert2.changesBy = function(fn, obj, prop, delta, msg) {
|
|
7913
7986
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
7914
|
-
|
|
7987
|
+
let tmpMsg = delta;
|
|
7915
7988
|
delta = prop;
|
|
7916
7989
|
msg = tmpMsg;
|
|
7917
7990
|
} else if (arguments.length === 3) {
|
|
@@ -7929,7 +8002,7 @@ assert2.doesNotChange = function(fn, obj, prop, msg) {
|
|
|
7929
8002
|
};
|
|
7930
8003
|
assert2.changesButNotBy = function(fn, obj, prop, delta, msg) {
|
|
7931
8004
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
7932
|
-
|
|
8005
|
+
let tmpMsg = delta;
|
|
7933
8006
|
delta = prop;
|
|
7934
8007
|
msg = tmpMsg;
|
|
7935
8008
|
} else if (arguments.length === 3) {
|
|
@@ -7947,7 +8020,7 @@ assert2.increases = function(fn, obj, prop, msg) {
|
|
|
7947
8020
|
};
|
|
7948
8021
|
assert2.increasesBy = function(fn, obj, prop, delta, msg) {
|
|
7949
8022
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
7950
|
-
|
|
8023
|
+
let tmpMsg = delta;
|
|
7951
8024
|
delta = prop;
|
|
7952
8025
|
msg = tmpMsg;
|
|
7953
8026
|
} else if (arguments.length === 3) {
|
|
@@ -7965,7 +8038,7 @@ assert2.doesNotIncrease = function(fn, obj, prop, msg) {
|
|
|
7965
8038
|
};
|
|
7966
8039
|
assert2.increasesButNotBy = function(fn, obj, prop, delta, msg) {
|
|
7967
8040
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
7968
|
-
|
|
8041
|
+
let tmpMsg = delta;
|
|
7969
8042
|
delta = prop;
|
|
7970
8043
|
msg = tmpMsg;
|
|
7971
8044
|
} else if (arguments.length === 3) {
|
|
@@ -7983,7 +8056,7 @@ assert2.decreases = function(fn, obj, prop, msg) {
|
|
|
7983
8056
|
};
|
|
7984
8057
|
assert2.decreasesBy = function(fn, obj, prop, delta, msg) {
|
|
7985
8058
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
7986
|
-
|
|
8059
|
+
let tmpMsg = delta;
|
|
7987
8060
|
delta = prop;
|
|
7988
8061
|
msg = tmpMsg;
|
|
7989
8062
|
} else if (arguments.length === 3) {
|
|
@@ -8001,7 +8074,7 @@ assert2.doesNotDecrease = function(fn, obj, prop, msg) {
|
|
|
8001
8074
|
};
|
|
8002
8075
|
assert2.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) {
|
|
8003
8076
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8004
|
-
|
|
8077
|
+
let tmpMsg = delta;
|
|
8005
8078
|
delta = prop;
|
|
8006
8079
|
msg = tmpMsg;
|
|
8007
8080
|
} else if (arguments.length === 3) {
|
|
@@ -8012,7 +8085,7 @@ assert2.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) {
|
|
|
8012
8085
|
};
|
|
8013
8086
|
assert2.decreasesButNotBy = function(fn, obj, prop, delta, msg) {
|
|
8014
8087
|
if (arguments.length === 4 && typeof obj === "function") {
|
|
8015
|
-
|
|
8088
|
+
let tmpMsg = delta;
|
|
8016
8089
|
delta = prop;
|
|
8017
8090
|
msg = tmpMsg;
|
|
8018
8091
|
} else if (arguments.length === 3) {
|
|
@@ -8123,7 +8196,7 @@ for (const [name, as] of aliases) {
|
|
|
8123
8196
|
}
|
|
8124
8197
|
var used = [];
|
|
8125
8198
|
function use(fn) {
|
|
8126
|
-
const exports = {
|
|
8199
|
+
const exports$1 = {
|
|
8127
8200
|
use,
|
|
8128
8201
|
AssertionError,
|
|
8129
8202
|
util: utils_exports,
|
|
@@ -8134,18 +8207,18 @@ function use(fn) {
|
|
|
8134
8207
|
...should_exports
|
|
8135
8208
|
};
|
|
8136
8209
|
if (!~used.indexOf(fn)) {
|
|
8137
|
-
fn(exports, utils_exports);
|
|
8210
|
+
fn(exports$1, utils_exports);
|
|
8138
8211
|
used.push(fn);
|
|
8139
8212
|
}
|
|
8140
|
-
return exports;
|
|
8213
|
+
return exports$1;
|
|
8141
8214
|
}
|
|
8142
8215
|
__name(use, "use");
|
|
8143
8216
|
__name2(use, "use");
|
|
8144
8217
|
|
|
8145
|
-
// ../../node_modules/.pnpm/@vitest+runner@3.2.
|
|
8218
|
+
// ../../node_modules/.pnpm/@vitest+runner@3.2.4/node_modules/@vitest/runner/dist/utils.js
|
|
8146
8219
|
init_esm_shims();
|
|
8147
8220
|
|
|
8148
|
-
// ../../node_modules/.pnpm/vitest@3.2.
|
|
8221
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@types+debug@4.1.12_@types+node@22.19.1_jiti@2.6.1_lightningcss@1.30.1_terser@5.44.1_tsx@4.20.6_yaml@2.8.1/node_modules/vitest/dist/index.js
|
|
8149
8222
|
var import_expect_type = __toESM(require_dist(), 1);
|
|
8150
8223
|
/*! Bundled license information:
|
|
8151
8224
|
|
|
@@ -8187,7 +8260,7 @@ var import_expect_type = __toESM(require_dist(), 1);
|
|
|
8187
8260
|
* LICENSE file in the root directory of this source tree.
|
|
8188
8261
|
*)
|
|
8189
8262
|
|
|
8190
|
-
chai/
|
|
8263
|
+
chai/index.js:
|
|
8191
8264
|
(*!
|
|
8192
8265
|
* Chai - flag utility
|
|
8193
8266
|
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
|
@@ -8431,5 +8504,5 @@ chai/chai.js:
|
|
|
8431
8504
|
*/
|
|
8432
8505
|
|
|
8433
8506
|
export { import_expect_type, test2 as test };
|
|
8434
|
-
//# sourceMappingURL=
|
|
8435
|
-
//# sourceMappingURL=
|
|
8507
|
+
//# sourceMappingURL=CI7BVOAG.js.map
|
|
8508
|
+
//# sourceMappingURL=CI7BVOAG.js.map
|