@lokascript/framework 6.3.0 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +104 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/languages/ar.cjs +7 -0
- package/dist/languages/ar.cjs.map +1 -0
- package/dist/languages/ar.d.ts +49 -0
- package/dist/languages/ar.d.ts.map +1 -0
- package/dist/languages/ar.js +7 -0
- package/dist/languages/ar.js.map +1 -0
- package/dist/languages/bn.cjs +7 -0
- package/dist/languages/bn.cjs.map +1 -0
- package/dist/languages/bn.d.ts +58 -0
- package/dist/languages/bn.d.ts.map +1 -0
- package/dist/languages/bn.js +7 -0
- package/dist/languages/bn.js.map +1 -0
- package/dist/languages/chunks/chunk-2Y3XXFQO.cjs +47 -0
- package/dist/languages/chunks/chunk-2Y3XXFQO.cjs.map +1 -0
- package/dist/languages/chunks/chunk-7JFC6YCG.cjs +38 -0
- package/dist/languages/chunks/chunk-7JFC6YCG.cjs.map +1 -0
- package/dist/languages/chunks/chunk-7M7D3AZV.js +36 -0
- package/dist/languages/chunks/chunk-7M7D3AZV.js.map +1 -0
- package/dist/languages/chunks/chunk-BLWOTGS4.cjs +33 -0
- package/dist/languages/chunks/chunk-BLWOTGS4.cjs.map +1 -0
- package/dist/languages/chunks/chunk-BNU64ZWY.cjs +33 -0
- package/dist/languages/chunks/chunk-BNU64ZWY.cjs.map +1 -0
- package/dist/languages/chunks/chunk-CCC73SLG.js +33 -0
- package/dist/languages/chunks/chunk-CCC73SLG.js.map +1 -0
- package/dist/languages/chunks/chunk-CEZSJJBE.js +35 -0
- package/dist/languages/chunks/chunk-CEZSJJBE.js.map +1 -0
- package/dist/languages/chunks/chunk-CJPWN3UM.cjs +33 -0
- package/dist/languages/chunks/chunk-CJPWN3UM.cjs.map +1 -0
- package/dist/languages/chunks/chunk-CZUFBVAP.cjs +36 -0
- package/dist/languages/chunks/chunk-CZUFBVAP.cjs.map +1 -0
- package/dist/languages/chunks/chunk-DFQ7CZ43.js +32 -0
- package/dist/languages/chunks/chunk-DFQ7CZ43.js.map +1 -0
- package/dist/languages/chunks/chunk-DZIG3L3C.js +33 -0
- package/dist/languages/chunks/chunk-DZIG3L3C.js.map +1 -0
- package/dist/languages/chunks/chunk-EEEJDKZH.cjs +41 -0
- package/dist/languages/chunks/chunk-EEEJDKZH.cjs.map +1 -0
- package/dist/languages/chunks/chunk-EH3CS6QF.cjs +39 -0
- package/dist/languages/chunks/chunk-EH3CS6QF.cjs.map +1 -0
- package/dist/languages/chunks/chunk-EQVZR5WU.js +36 -0
- package/dist/languages/chunks/chunk-EQVZR5WU.js.map +1 -0
- package/dist/languages/chunks/chunk-EY2I2PZI.cjs +42 -0
- package/dist/languages/chunks/chunk-EY2I2PZI.cjs.map +1 -0
- package/dist/languages/chunks/chunk-FDD6SCYE.js +38 -0
- package/dist/languages/chunks/chunk-FDD6SCYE.js.map +1 -0
- package/dist/languages/chunks/chunk-FDL3DCUR.cjs +38 -0
- package/dist/languages/chunks/chunk-FDL3DCUR.cjs.map +1 -0
- package/dist/languages/chunks/chunk-FQZEBNEC.js +32 -0
- package/dist/languages/chunks/chunk-FQZEBNEC.js.map +1 -0
- package/dist/languages/chunks/chunk-FXKGDEEF.js +32 -0
- package/dist/languages/chunks/chunk-FXKGDEEF.js.map +1 -0
- package/dist/languages/chunks/chunk-G727KC5F.js +34 -0
- package/dist/languages/chunks/chunk-G727KC5F.js.map +1 -0
- package/dist/languages/chunks/chunk-HRTBXKAS.js +34 -0
- package/dist/languages/chunks/chunk-HRTBXKAS.js.map +1 -0
- package/dist/languages/chunks/chunk-HTWLJAXE.cjs +34 -0
- package/dist/languages/chunks/chunk-HTWLJAXE.cjs.map +1 -0
- package/dist/languages/chunks/chunk-IG2BHTIU.js +50 -0
- package/dist/languages/chunks/chunk-IG2BHTIU.js.map +1 -0
- package/dist/languages/chunks/chunk-JJGECSB7.js +44 -0
- package/dist/languages/chunks/chunk-JJGECSB7.js.map +1 -0
- package/dist/languages/chunks/chunk-KPGJSWSP.js +32 -0
- package/dist/languages/chunks/chunk-KPGJSWSP.js.map +1 -0
- package/dist/languages/chunks/chunk-LGZCHKVL.cjs +50 -0
- package/dist/languages/chunks/chunk-LGZCHKVL.cjs.map +1 -0
- package/dist/languages/chunks/chunk-LMRNA2XQ.cjs +35 -0
- package/dist/languages/chunks/chunk-LMRNA2XQ.cjs.map +1 -0
- package/dist/languages/chunks/chunk-NS4L6RCJ.js +42 -0
- package/dist/languages/chunks/chunk-NS4L6RCJ.js.map +1 -0
- package/dist/languages/chunks/chunk-OGVDC4MV.js +33 -0
- package/dist/languages/chunks/chunk-OGVDC4MV.js.map +1 -0
- package/dist/languages/chunks/chunk-OOI6MH2H.js +47 -0
- package/dist/languages/chunks/chunk-OOI6MH2H.js.map +1 -0
- package/dist/languages/chunks/chunk-OSHTQPFA.js +35 -0
- package/dist/languages/chunks/chunk-OSHTQPFA.js.map +1 -0
- package/dist/languages/chunks/chunk-P2ONCOPE.js +33 -0
- package/dist/languages/chunks/chunk-P2ONCOPE.js.map +1 -0
- package/dist/languages/chunks/chunk-PC4BLDMN.js +41 -0
- package/dist/languages/chunks/chunk-PC4BLDMN.js.map +1 -0
- package/dist/languages/chunks/chunk-Q7Z57FEP.js +39 -0
- package/dist/languages/chunks/chunk-Q7Z57FEP.js.map +1 -0
- package/dist/languages/chunks/chunk-SFDLZDQC.cjs +36 -0
- package/dist/languages/chunks/chunk-SFDLZDQC.cjs.map +1 -0
- package/dist/languages/chunks/chunk-SLSZETLO.js +39 -0
- package/dist/languages/chunks/chunk-SLSZETLO.js.map +1 -0
- package/dist/languages/chunks/chunk-T5QEXBP6.cjs +39 -0
- package/dist/languages/chunks/chunk-T5QEXBP6.cjs.map +1 -0
- package/dist/languages/chunks/chunk-TM54B2L7.cjs +34 -0
- package/dist/languages/chunks/chunk-TM54B2L7.cjs.map +1 -0
- package/dist/languages/chunks/chunk-UYYD7BWL.cjs +32 -0
- package/dist/languages/chunks/chunk-UYYD7BWL.cjs.map +1 -0
- package/dist/languages/chunks/chunk-V3EPOWJS.cjs +32 -0
- package/dist/languages/chunks/chunk-V3EPOWJS.cjs.map +1 -0
- package/dist/languages/chunks/chunk-W4Y2BHDV.cjs +33 -0
- package/dist/languages/chunks/chunk-W4Y2BHDV.cjs.map +1 -0
- package/dist/languages/chunks/chunk-W7UIUU64.cjs +32 -0
- package/dist/languages/chunks/chunk-W7UIUU64.cjs.map +1 -0
- package/dist/languages/chunks/chunk-WOTY3GYE.cjs +44 -0
- package/dist/languages/chunks/chunk-WOTY3GYE.cjs.map +1 -0
- package/dist/languages/chunks/chunk-WYH4M6NK.js +78 -0
- package/dist/languages/chunks/chunk-WYH4M6NK.js.map +1 -0
- package/dist/languages/chunks/chunk-XFSNOEMB.cjs +32 -0
- package/dist/languages/chunks/chunk-XFSNOEMB.cjs.map +1 -0
- package/dist/languages/chunks/chunk-XHHTLZRZ.cjs +78 -0
- package/dist/languages/chunks/chunk-XHHTLZRZ.cjs.map +1 -0
- package/dist/languages/chunks/chunk-YTZILXWL.cjs +35 -0
- package/dist/languages/chunks/chunk-YTZILXWL.cjs.map +1 -0
- package/dist/languages/chunks/chunk-ZLMXABY7.js +38 -0
- package/dist/languages/chunks/chunk-ZLMXABY7.js.map +1 -0
- package/dist/languages/de.cjs +7 -0
- package/dist/languages/de.cjs.map +1 -0
- package/dist/languages/de.d.ts +47 -0
- package/dist/languages/de.d.ts.map +1 -0
- package/dist/languages/de.js +7 -0
- package/dist/languages/de.js.map +1 -0
- package/dist/languages/en.cjs +7 -0
- package/dist/languages/en.cjs.map +1 -0
- package/dist/languages/en.d.ts +54 -0
- package/dist/languages/en.d.ts.map +1 -0
- package/dist/languages/en.js +7 -0
- package/dist/languages/en.js.map +1 -0
- package/dist/languages/es.cjs +7 -0
- package/dist/languages/es.cjs.map +1 -0
- package/dist/languages/es.d.ts +47 -0
- package/dist/languages/es.d.ts.map +1 -0
- package/dist/languages/es.js +7 -0
- package/dist/languages/es.js.map +1 -0
- package/dist/languages/fr.cjs +7 -0
- package/dist/languages/fr.cjs.map +1 -0
- package/dist/languages/fr.d.ts +47 -0
- package/dist/languages/fr.d.ts.map +1 -0
- package/dist/languages/fr.js +7 -0
- package/dist/languages/fr.js.map +1 -0
- package/dist/languages/he.cjs +7 -0
- package/dist/languages/he.cjs.map +1 -0
- package/dist/languages/he.d.ts +51 -0
- package/dist/languages/he.d.ts.map +1 -0
- package/dist/languages/he.js +7 -0
- package/dist/languages/he.js.map +1 -0
- package/dist/languages/hi.cjs +7 -0
- package/dist/languages/hi.cjs.map +1 -0
- package/dist/languages/hi.d.ts +54 -0
- package/dist/languages/hi.d.ts.map +1 -0
- package/dist/languages/hi.js +7 -0
- package/dist/languages/hi.js.map +1 -0
- package/dist/languages/id.cjs +7 -0
- package/dist/languages/id.cjs.map +1 -0
- package/dist/languages/id.d.ts +45 -0
- package/dist/languages/id.d.ts.map +1 -0
- package/dist/languages/id.js +7 -0
- package/dist/languages/id.js.map +1 -0
- package/dist/languages/index.cjs +99 -0
- package/dist/languages/index.cjs.map +1 -0
- package/dist/languages/index.d.ts +30 -0
- package/dist/languages/index.d.ts.map +1 -0
- package/dist/languages/index.js +99 -0
- package/dist/languages/index.js.map +1 -0
- package/dist/languages/it.cjs +7 -0
- package/dist/languages/it.cjs.map +1 -0
- package/dist/languages/it.d.ts +48 -0
- package/dist/languages/it.d.ts.map +1 -0
- package/dist/languages/it.js +7 -0
- package/dist/languages/it.js.map +1 -0
- package/dist/languages/ja.cjs +7 -0
- package/dist/languages/ja.cjs.map +1 -0
- package/dist/languages/ja.d.ts +58 -0
- package/dist/languages/ja.d.ts.map +1 -0
- package/dist/languages/ja.js +7 -0
- package/dist/languages/ja.js.map +1 -0
- package/dist/languages/ko.cjs +7 -0
- package/dist/languages/ko.cjs.map +1 -0
- package/dist/languages/ko.d.ts +61 -0
- package/dist/languages/ko.d.ts.map +1 -0
- package/dist/languages/ko.js +7 -0
- package/dist/languages/ko.js.map +1 -0
- package/dist/languages/ms.cjs +7 -0
- package/dist/languages/ms.cjs.map +1 -0
- package/dist/languages/ms.d.ts +44 -0
- package/dist/languages/ms.d.ts.map +1 -0
- package/dist/languages/ms.js +7 -0
- package/dist/languages/ms.js.map +1 -0
- package/dist/languages/pl.cjs +7 -0
- package/dist/languages/pl.cjs.map +1 -0
- package/dist/languages/pl.d.ts +50 -0
- package/dist/languages/pl.d.ts.map +1 -0
- package/dist/languages/pl.js +7 -0
- package/dist/languages/pl.js.map +1 -0
- package/dist/languages/pt.cjs +7 -0
- package/dist/languages/pt.cjs.map +1 -0
- package/dist/languages/pt.d.ts +46 -0
- package/dist/languages/pt.d.ts.map +1 -0
- package/dist/languages/pt.js +7 -0
- package/dist/languages/pt.js.map +1 -0
- package/dist/languages/qu.cjs +7 -0
- package/dist/languages/qu.cjs.map +1 -0
- package/dist/languages/qu.d.ts +48 -0
- package/dist/languages/qu.d.ts.map +1 -0
- package/dist/languages/qu.js +7 -0
- package/dist/languages/qu.js.map +1 -0
- package/dist/languages/ru.cjs +7 -0
- package/dist/languages/ru.cjs.map +1 -0
- package/dist/languages/ru.d.ts +50 -0
- package/dist/languages/ru.d.ts.map +1 -0
- package/dist/languages/ru.js +7 -0
- package/dist/languages/ru.js.map +1 -0
- package/dist/languages/sw.cjs +7 -0
- package/dist/languages/sw.cjs.map +1 -0
- package/dist/languages/sw.d.ts +45 -0
- package/dist/languages/sw.d.ts.map +1 -0
- package/dist/languages/sw.js +7 -0
- package/dist/languages/sw.js.map +1 -0
- package/dist/languages/th.cjs +7 -0
- package/dist/languages/th.cjs.map +1 -0
- package/dist/languages/th.d.ts +48 -0
- package/dist/languages/th.d.ts.map +1 -0
- package/dist/languages/th.js +7 -0
- package/dist/languages/th.js.map +1 -0
- package/dist/languages/tl.cjs +7 -0
- package/dist/languages/tl.cjs.map +1 -0
- package/dist/languages/tl.d.ts +44 -0
- package/dist/languages/tl.d.ts.map +1 -0
- package/dist/languages/tl.js +7 -0
- package/dist/languages/tl.js.map +1 -0
- package/dist/languages/tr.cjs +7 -0
- package/dist/languages/tr.cjs.map +1 -0
- package/dist/languages/tr.d.ts +57 -0
- package/dist/languages/tr.d.ts.map +1 -0
- package/dist/languages/tr.js +7 -0
- package/dist/languages/tr.js.map +1 -0
- package/dist/languages/types.d.ts +137 -0
- package/dist/languages/types.d.ts.map +1 -0
- package/dist/languages/uk.cjs +7 -0
- package/dist/languages/uk.cjs.map +1 -0
- package/dist/languages/uk.d.ts +50 -0
- package/dist/languages/uk.d.ts.map +1 -0
- package/dist/languages/uk.js +7 -0
- package/dist/languages/uk.js.map +1 -0
- package/dist/languages/vi.cjs +7 -0
- package/dist/languages/vi.cjs.map +1 -0
- package/dist/languages/vi.d.ts +47 -0
- package/dist/languages/vi.d.ts.map +1 -0
- package/dist/languages/vi.js +7 -0
- package/dist/languages/vi.js.map +1 -0
- package/dist/languages/zh.cjs +7 -0
- package/dist/languages/zh.cjs.map +1 -0
- package/dist/languages/zh.d.ts +49 -0
- package/dist/languages/zh.d.ts.map +1 -0
- package/dist/languages/zh.js +7 -0
- package/dist/languages/zh.js.map +1 -0
- package/dist/testing/index.js +1416 -930
- package/dist/testing/index.js.map +1 -1
- package/package.json +130 -5
- package/src/index.ts +2 -0
- package/src/languages/ar.ts +41 -0
- package/src/languages/bn.ts +45 -0
- package/src/languages/de.ts +37 -0
- package/src/languages/en.ts +36 -0
- package/src/languages/es.ts +40 -0
- package/src/languages/fr.ts +36 -0
- package/src/languages/he.ts +38 -0
- package/src/languages/hi.ts +44 -0
- package/src/languages/id.ts +34 -0
- package/src/languages/index.ts +42 -0
- package/src/languages/it.ts +38 -0
- package/src/languages/ja.ts +49 -0
- package/src/languages/ko.ts +50 -0
- package/src/languages/languages.test.ts +57 -0
- package/src/languages/ms.ts +33 -0
- package/src/languages/pl.ts +39 -0
- package/src/languages/pt.ts +34 -0
- package/src/languages/qu.ts +34 -0
- package/src/languages/ru.ts +37 -0
- package/src/languages/sw.ts +34 -0
- package/src/languages/th.ts +44 -0
- package/src/languages/tl.ts +37 -0
- package/src/languages/tr.ts +76 -0
- package/src/languages/types.ts +145 -0
- package/src/languages/uk.ts +37 -0
- package/src/languages/vi.ts +36 -0
- package/src/languages/zh.ts +36 -0
package/dist/testing/index.js
CHANGED
|
@@ -4,9 +4,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __typeError = (msg) => {
|
|
8
|
-
throw TypeError(msg);
|
|
9
|
-
};
|
|
10
7
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
8
|
var __esm = (fn2, res) => function __init() {
|
|
12
9
|
return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
|
|
@@ -35,10 +32,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
35
32
|
mod
|
|
36
33
|
));
|
|
37
34
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
38
|
-
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
39
|
-
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
40
|
-
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
41
|
-
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
42
35
|
|
|
43
36
|
// ../../node_modules/expect-type/dist/branding.js
|
|
44
37
|
var require_branding = __commonJS({
|
|
@@ -109,7 +102,7 @@ var require_dist = __commonJS({
|
|
|
109
102
|
o2[k2] = m2[k];
|
|
110
103
|
}));
|
|
111
104
|
var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
|
|
112
|
-
for (var
|
|
105
|
+
for (var p2 in m2) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m2, p2);
|
|
113
106
|
};
|
|
114
107
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
115
108
|
exports.expectTypeOf = void 0;
|
|
@@ -197,11 +190,11 @@ function encodeRangeMappings(decoded) {
|
|
|
197
190
|
for (let i3 = 0; i3 < decoded.length; i3++) {
|
|
198
191
|
const indices = decoded[i3];
|
|
199
192
|
if (i3 > 0) writer.write(semicolon);
|
|
200
|
-
let
|
|
193
|
+
let index2 = 0;
|
|
201
194
|
for (let j = 0; j < indices.length; j++) {
|
|
202
195
|
const offset = indices[j];
|
|
203
|
-
encodeInteger(writer, offset -
|
|
204
|
-
|
|
196
|
+
encodeInteger(writer, offset - index2);
|
|
197
|
+
index2 = offset;
|
|
205
198
|
}
|
|
206
199
|
}
|
|
207
200
|
return writer.flush();
|
|
@@ -246,9 +239,9 @@ var init_sourcemap_codec = __esm({
|
|
|
246
239
|
intToChar3 = new Uint8Array(64);
|
|
247
240
|
charToInt3 = new Uint8Array(128);
|
|
248
241
|
for (let i3 = 0; i3 < chars3.length; i3++) {
|
|
249
|
-
const
|
|
250
|
-
intToChar3[i3] =
|
|
251
|
-
charToInt3[
|
|
242
|
+
const c2 = chars3.charCodeAt(i3);
|
|
243
|
+
intToChar3[i3] = c2;
|
|
244
|
+
charToInt3[c2] = i3;
|
|
252
245
|
}
|
|
253
246
|
bufLength = 1024 * 16;
|
|
254
247
|
td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
@@ -287,7 +280,7 @@ var init_sourcemap_codec = __esm({
|
|
|
287
280
|
}
|
|
288
281
|
});
|
|
289
282
|
|
|
290
|
-
// node_modules/magic-string/dist/index.mjs
|
|
283
|
+
// ../../node_modules/vitest/node_modules/magic-string/dist/index.mjs
|
|
291
284
|
var dist_exports = {};
|
|
292
285
|
__export(dist_exports, {
|
|
293
286
|
Bundle: () => Bundle,
|
|
@@ -307,18 +300,18 @@ function getBtoa() {
|
|
|
307
300
|
function getLocator(source) {
|
|
308
301
|
const lineOffsets = [0];
|
|
309
302
|
for (let i3 = source.indexOf("\n"); i3 !== -1; i3 = source.indexOf("\n", i3 + 1)) lineOffsets.push(i3 + 1);
|
|
310
|
-
return function locate(
|
|
303
|
+
return function locate(index2) {
|
|
311
304
|
let i3 = 0;
|
|
312
305
|
let j = lineOffsets.length;
|
|
313
306
|
while (i3 < j) {
|
|
314
307
|
const m2 = i3 + j >> 1;
|
|
315
|
-
if (
|
|
308
|
+
if (index2 < lineOffsets[m2]) j = m2;
|
|
316
309
|
else i3 = m2 + 1;
|
|
317
310
|
}
|
|
318
311
|
const line = i3 - 1;
|
|
319
312
|
return {
|
|
320
313
|
line,
|
|
321
|
-
column:
|
|
314
|
+
column: index2 - lineOffsets[line]
|
|
322
315
|
};
|
|
323
316
|
};
|
|
324
317
|
}
|
|
@@ -367,14 +360,14 @@ function isWordCode(code) {
|
|
|
367
360
|
function expandReplacement(replacement, matched, position, str, captures, namedCaptures) {
|
|
368
361
|
if (!replacement.includes("$")) return replacement;
|
|
369
362
|
let result = "";
|
|
370
|
-
let
|
|
371
|
-
while (
|
|
372
|
-
const dollar = replacement.indexOf("$",
|
|
363
|
+
let index2 = 0;
|
|
364
|
+
while (index2 < replacement.length) {
|
|
365
|
+
const dollar = replacement.indexOf("$", index2);
|
|
373
366
|
if (dollar === -1) {
|
|
374
|
-
result += replacement.slice(
|
|
367
|
+
result += replacement.slice(index2);
|
|
375
368
|
break;
|
|
376
369
|
}
|
|
377
|
-
result += replacement.slice(
|
|
370
|
+
result += replacement.slice(index2, dollar);
|
|
378
371
|
const char = replacement[dollar + 1];
|
|
379
372
|
let expansion = "$";
|
|
380
373
|
let consumed = 1;
|
|
@@ -407,24 +400,24 @@ function expandReplacement(replacement, matched, position, str, captures, namedC
|
|
|
407
400
|
}
|
|
408
401
|
}
|
|
409
402
|
result += expansion;
|
|
410
|
-
|
|
403
|
+
index2 = dollar + consumed;
|
|
411
404
|
}
|
|
412
405
|
return result;
|
|
413
406
|
}
|
|
414
|
-
var BitSet, Chunk, MagicStringError, btoa, SourceMap, toString3, BASE64_CHARS, intToChar4, COMMA, SEMICOLON, BUFFER_SIZE, FLUSH_THRESHOLD, scratch, decoder, MappingsEncoder, NEWLINE_CHAR$1, Mappings,
|
|
407
|
+
var BitSet, Chunk, MagicStringError, btoa, SourceMap, toString3, BASE64_CHARS, intToChar4, COMMA, SEMICOLON, BUFFER_SIZE, FLUSH_THRESHOLD, scratch, decoder, MappingsEncoder, NEWLINE_CHAR$1, Mappings, n, NEWLINE_CHAR, CR_CHAR, warned, MagicString, hasOwnProp, Bundle;
|
|
415
408
|
var init_dist = __esm({
|
|
416
|
-
"node_modules/magic-string/dist/index.mjs"() {
|
|
409
|
+
"../../node_modules/vitest/node_modules/magic-string/dist/index.mjs"() {
|
|
417
410
|
"use strict";
|
|
418
411
|
init_sourcemap_codec();
|
|
419
412
|
BitSet = class BitSet2 {
|
|
420
413
|
constructor(arg) {
|
|
421
414
|
this.bits = arg instanceof BitSet2 ? arg.bits.slice() : [];
|
|
422
415
|
}
|
|
423
|
-
add(
|
|
424
|
-
this.bits[
|
|
416
|
+
add(n2) {
|
|
417
|
+
this.bits[n2 >> 5] |= 1 << (n2 & 31);
|
|
425
418
|
}
|
|
426
|
-
has(
|
|
427
|
-
return !!(this.bits[
|
|
419
|
+
has(n2) {
|
|
420
|
+
return !!(this.bits[n2 >> 5] & 1 << (n2 & 31));
|
|
428
421
|
}
|
|
429
422
|
};
|
|
430
423
|
Chunk = class Chunk2 {
|
|
@@ -455,8 +448,8 @@ var init_dist = __esm({
|
|
|
455
448
|
chunk.edited = this.edited;
|
|
456
449
|
return chunk;
|
|
457
450
|
}
|
|
458
|
-
contains(
|
|
459
|
-
return this.start <
|
|
451
|
+
contains(index2) {
|
|
452
|
+
return this.start < index2 && index2 < this.end;
|
|
460
453
|
}
|
|
461
454
|
eachNext(fn2) {
|
|
462
455
|
fn2(this);
|
|
@@ -499,15 +492,15 @@ var init_dist = __esm({
|
|
|
499
492
|
this.edited = false;
|
|
500
493
|
}
|
|
501
494
|
}
|
|
502
|
-
split(
|
|
503
|
-
const sliceIndex =
|
|
495
|
+
split(index2) {
|
|
496
|
+
const sliceIndex = index2 - this.start;
|
|
504
497
|
const originalBefore = this.original.slice(0, sliceIndex);
|
|
505
498
|
const originalAfter = this.original.slice(sliceIndex);
|
|
506
499
|
this.original = originalBefore;
|
|
507
|
-
const newChunk = new Chunk2(
|
|
500
|
+
const newChunk = new Chunk2(index2, this.end, originalAfter);
|
|
508
501
|
newChunk.outro = this.outro;
|
|
509
502
|
this.outro = "";
|
|
510
|
-
this.end =
|
|
503
|
+
this.end = index2;
|
|
511
504
|
if (this.edited) {
|
|
512
505
|
newChunk.edit("", false, true);
|
|
513
506
|
this.content = "";
|
|
@@ -814,9 +807,9 @@ var init_dist = __esm({
|
|
|
814
807
|
const base = w << 5;
|
|
815
808
|
while (word) {
|
|
816
809
|
const lowest = word & -word;
|
|
817
|
-
const
|
|
818
|
-
if (
|
|
819
|
-
const offset =
|
|
810
|
+
const index2 = base + 31 - Math.clz32(lowest);
|
|
811
|
+
if (index2 > i3 && index2 < newline) {
|
|
812
|
+
const offset = index2 - i3;
|
|
820
813
|
this.rawSegments.push([
|
|
821
814
|
this.generatedCodeColumn + offset,
|
|
822
815
|
sourceIndex,
|
|
@@ -845,7 +838,7 @@ var init_dist = __esm({
|
|
|
845
838
|
this.generatedCodeColumn += str.length - lastNewline - 1;
|
|
846
839
|
}
|
|
847
840
|
};
|
|
848
|
-
|
|
841
|
+
n = "\n";
|
|
849
842
|
NEWLINE_CHAR = "\n".charCodeAt(0);
|
|
850
843
|
CR_CHAR = "\r".charCodeAt(0);
|
|
851
844
|
warned = {
|
|
@@ -942,11 +935,11 @@ var init_dist = __esm({
|
|
|
942
935
|
* If a range *ending* with index is subsequently moved, the insert will be moved with it.
|
|
943
936
|
* See also `s.prependLeft(...)`.
|
|
944
937
|
*/
|
|
945
|
-
appendLeft(
|
|
946
|
-
|
|
938
|
+
appendLeft(index2, content) {
|
|
939
|
+
index2 = index2 + this.offset;
|
|
947
940
|
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
948
|
-
this._split(
|
|
949
|
-
const chunk = this.byEnd.get(
|
|
941
|
+
this._split(index2);
|
|
942
|
+
const chunk = this.byEnd.get(index2);
|
|
950
943
|
if (chunk) chunk.appendLeft(content);
|
|
951
944
|
else this.intro += content;
|
|
952
945
|
return this;
|
|
@@ -956,11 +949,11 @@ var init_dist = __esm({
|
|
|
956
949
|
* If a range *starting* with index is subsequently moved, the insert will be moved with it.
|
|
957
950
|
* See also `s.prependRight(...)`.
|
|
958
951
|
*/
|
|
959
|
-
appendRight(
|
|
960
|
-
|
|
952
|
+
appendRight(index2, content) {
|
|
953
|
+
index2 = index2 + this.offset;
|
|
961
954
|
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
962
|
-
this._split(
|
|
963
|
-
const chunk = this.byStart.get(
|
|
955
|
+
this._split(index2);
|
|
956
|
+
const chunk = this.byStart.get(index2);
|
|
964
957
|
if (chunk) chunk.appendRight(content);
|
|
965
958
|
else this.outro += content;
|
|
966
959
|
return this;
|
|
@@ -1091,11 +1084,11 @@ var init_dist = __esm({
|
|
|
1091
1084
|
this.intro = indentPiece(this.intro);
|
|
1092
1085
|
let charIndex = 0;
|
|
1093
1086
|
let chunk = this.firstChunk;
|
|
1094
|
-
const indentAt = (
|
|
1087
|
+
const indentAt = (index2) => {
|
|
1095
1088
|
shouldIndentNextCharacter = false;
|
|
1096
|
-
if (
|
|
1089
|
+
if (index2 === chunk.start) chunk.appendRight(resolvedIndentStr);
|
|
1097
1090
|
else {
|
|
1098
|
-
this._splitChunk(chunk,
|
|
1091
|
+
this._splitChunk(chunk, index2);
|
|
1099
1092
|
chunk = chunk.next;
|
|
1100
1093
|
chunk.prependRight(resolvedIndentStr);
|
|
1101
1094
|
}
|
|
@@ -1119,7 +1112,7 @@ var init_dist = __esm({
|
|
|
1119
1112
|
charIndex = chunk.start;
|
|
1120
1113
|
while (charIndex < end) {
|
|
1121
1114
|
if (!shouldIndentNextCharacter) {
|
|
1122
|
-
const nextLine = this.original.indexOf(
|
|
1115
|
+
const nextLine = this.original.indexOf(n, charIndex);
|
|
1123
1116
|
if (nextLine === -1 || nextLine >= end) break;
|
|
1124
1117
|
shouldIndentNextCharacter = true;
|
|
1125
1118
|
charIndex = nextLine + 1;
|
|
@@ -1146,20 +1139,20 @@ var init_dist = __esm({
|
|
|
1146
1139
|
throw new MagicStringError("insert() is deprecated, use appendLeft() or prependRight()");
|
|
1147
1140
|
}
|
|
1148
1141
|
/** @internal */
|
|
1149
|
-
insertLeft(
|
|
1142
|
+
insertLeft(index2, content) {
|
|
1150
1143
|
if (!warned.insertLeft) {
|
|
1151
1144
|
console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead");
|
|
1152
1145
|
warned.insertLeft = true;
|
|
1153
1146
|
}
|
|
1154
|
-
return this.appendLeft(
|
|
1147
|
+
return this.appendLeft(index2, content);
|
|
1155
1148
|
}
|
|
1156
1149
|
/** @internal */
|
|
1157
|
-
insertRight(
|
|
1150
|
+
insertRight(index2, content) {
|
|
1158
1151
|
if (!warned.insertRight) {
|
|
1159
1152
|
console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead");
|
|
1160
1153
|
warned.insertRight = true;
|
|
1161
1154
|
}
|
|
1162
|
-
return this.prependRight(
|
|
1155
|
+
return this.prependRight(index2, content);
|
|
1163
1156
|
}
|
|
1164
1157
|
/**
|
|
1165
1158
|
* Moves the characters from `start` and `end` to `index`.
|
|
@@ -1170,15 +1163,15 @@ var init_dist = __esm({
|
|
|
1170
1163
|
* two differ only when other content has already been moved to that boundary,
|
|
1171
1164
|
* mirroring the `appendLeft`/`appendRight` distinction.
|
|
1172
1165
|
*/
|
|
1173
|
-
move(start, end,
|
|
1166
|
+
move(start, end, index2, affinity = "right") {
|
|
1174
1167
|
start = start + this.offset;
|
|
1175
1168
|
end = end + this.offset;
|
|
1176
|
-
|
|
1169
|
+
index2 = index2 + this.offset;
|
|
1177
1170
|
if (start === end) return this;
|
|
1178
|
-
if (
|
|
1171
|
+
if (index2 >= start && index2 <= end) throw new MagicStringError("cannot move a selection inside itself");
|
|
1179
1172
|
this._split(start);
|
|
1180
1173
|
this._split(end);
|
|
1181
|
-
this._split(
|
|
1174
|
+
this._split(index2);
|
|
1182
1175
|
const first = this.byStart.get(start);
|
|
1183
1176
|
const last = this.byEnd.get(end);
|
|
1184
1177
|
if (this.hasMovedChunks) {
|
|
@@ -1193,7 +1186,7 @@ var init_dist = __esm({
|
|
|
1193
1186
|
let newLeft;
|
|
1194
1187
|
let newRight;
|
|
1195
1188
|
if (affinity === "left") {
|
|
1196
|
-
newLeft = this.byEnd.get(
|
|
1189
|
+
newLeft = this.byEnd.get(index2) ?? null;
|
|
1197
1190
|
if (!newLeft) {
|
|
1198
1191
|
if (first === this.firstChunk) return this;
|
|
1199
1192
|
newRight = this.firstChunk;
|
|
@@ -1202,7 +1195,7 @@ var init_dist = __esm({
|
|
|
1202
1195
|
newRight = newLeft.next;
|
|
1203
1196
|
}
|
|
1204
1197
|
} else {
|
|
1205
|
-
newRight = this.byStart.get(
|
|
1198
|
+
newRight = this.byStart.get(index2) ?? null;
|
|
1206
1199
|
if (!newRight) {
|
|
1207
1200
|
if (last === this.lastChunk) return this;
|
|
1208
1201
|
newLeft = this.lastChunk;
|
|
@@ -1290,7 +1283,7 @@ var init_dist = __esm({
|
|
|
1290
1283
|
while (chunk !== last) {
|
|
1291
1284
|
if (chunk.next !== this.byStart.get(chunk.end)) throw new MagicStringError("cannot overwrite across a split point");
|
|
1292
1285
|
chunk = chunk.next;
|
|
1293
|
-
chunk.edit("", false);
|
|
1286
|
+
chunk.edit("", false, !overwrite);
|
|
1294
1287
|
}
|
|
1295
1288
|
first.edit(content, storeName, !overwrite);
|
|
1296
1289
|
} else {
|
|
@@ -1311,11 +1304,11 @@ var init_dist = __esm({
|
|
|
1311
1304
|
/**
|
|
1312
1305
|
* Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index
|
|
1313
1306
|
*/
|
|
1314
|
-
prependLeft(
|
|
1315
|
-
|
|
1307
|
+
prependLeft(index2, content) {
|
|
1308
|
+
index2 = index2 + this.offset;
|
|
1316
1309
|
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
1317
|
-
this._split(
|
|
1318
|
-
const chunk = this.byEnd.get(
|
|
1310
|
+
this._split(index2);
|
|
1311
|
+
const chunk = this.byEnd.get(index2);
|
|
1319
1312
|
if (chunk) chunk.prependLeft(content);
|
|
1320
1313
|
else this.intro = content + this.intro;
|
|
1321
1314
|
return this;
|
|
@@ -1323,11 +1316,11 @@ var init_dist = __esm({
|
|
|
1323
1316
|
/**
|
|
1324
1317
|
* Same as `s.appendRight(...)`, except that the inserted content will go *before* any previous appends or prepends at `index`
|
|
1325
1318
|
*/
|
|
1326
|
-
prependRight(
|
|
1327
|
-
|
|
1319
|
+
prependRight(index2, content) {
|
|
1320
|
+
index2 = index2 + this.offset;
|
|
1328
1321
|
if (typeof content !== "string") throw new MagicStringError(`content must be a string, got ${typeof content}`);
|
|
1329
|
-
this._split(
|
|
1330
|
-
const chunk = this.byStart.get(
|
|
1322
|
+
this._split(index2);
|
|
1323
|
+
const chunk = this.byStart.get(index2);
|
|
1331
1324
|
if (chunk) chunk.prependRight(content);
|
|
1332
1325
|
else this.outro = content + this.outro;
|
|
1333
1326
|
return this;
|
|
@@ -1395,29 +1388,29 @@ var init_dist = __esm({
|
|
|
1395
1388
|
return "";
|
|
1396
1389
|
}
|
|
1397
1390
|
lastLine() {
|
|
1398
|
-
let lineIndex = this.outro.lastIndexOf(
|
|
1391
|
+
let lineIndex = this.outro.lastIndexOf(n);
|
|
1399
1392
|
if (lineIndex !== -1) return this.outro.substr(lineIndex + 1);
|
|
1400
1393
|
let lineStr = this.outro;
|
|
1401
1394
|
let chunk = this.lastChunk;
|
|
1402
1395
|
while (chunk) {
|
|
1403
1396
|
if (chunk.outro.length > 0) {
|
|
1404
|
-
lineIndex = chunk.outro.lastIndexOf(
|
|
1397
|
+
lineIndex = chunk.outro.lastIndexOf(n);
|
|
1405
1398
|
if (lineIndex !== -1) return chunk.outro.substr(lineIndex + 1) + lineStr;
|
|
1406
1399
|
lineStr = chunk.outro + lineStr;
|
|
1407
1400
|
}
|
|
1408
1401
|
if (chunk.content.length > 0) {
|
|
1409
|
-
lineIndex = chunk.content.lastIndexOf(
|
|
1402
|
+
lineIndex = chunk.content.lastIndexOf(n);
|
|
1410
1403
|
if (lineIndex !== -1) return chunk.content.substr(lineIndex + 1) + lineStr;
|
|
1411
1404
|
lineStr = chunk.content + lineStr;
|
|
1412
1405
|
}
|
|
1413
1406
|
if (chunk.intro.length > 0) {
|
|
1414
|
-
lineIndex = chunk.intro.lastIndexOf(
|
|
1407
|
+
lineIndex = chunk.intro.lastIndexOf(n);
|
|
1415
1408
|
if (lineIndex !== -1) return chunk.intro.substr(lineIndex + 1) + lineStr;
|
|
1416
1409
|
lineStr = chunk.intro + lineStr;
|
|
1417
1410
|
}
|
|
1418
1411
|
chunk = chunk.previous;
|
|
1419
1412
|
}
|
|
1420
|
-
lineIndex = this.intro.lastIndexOf(
|
|
1413
|
+
lineIndex = this.intro.lastIndexOf(n);
|
|
1421
1414
|
if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
|
|
1422
1415
|
return this.intro + lineStr;
|
|
1423
1416
|
}
|
|
@@ -1464,27 +1457,27 @@ var init_dist = __esm({
|
|
|
1464
1457
|
return clone2;
|
|
1465
1458
|
}
|
|
1466
1459
|
/** @internal */
|
|
1467
|
-
_split(
|
|
1468
|
-
if (this.byStart.get(
|
|
1460
|
+
_split(index2) {
|
|
1461
|
+
if (this.byStart.get(index2) || this.byEnd.get(index2)) return;
|
|
1469
1462
|
let chunk = this.lastSearchedChunk;
|
|
1470
1463
|
let previousChunk = chunk;
|
|
1471
|
-
const searchForward =
|
|
1464
|
+
const searchForward = index2 > chunk.end;
|
|
1472
1465
|
while (chunk) {
|
|
1473
|
-
if (chunk.contains(
|
|
1466
|
+
if (chunk.contains(index2)) return this._splitChunk(chunk, index2);
|
|
1474
1467
|
chunk = searchForward ? this.byStart.get(chunk.end) : this.byEnd.get(chunk.start);
|
|
1475
1468
|
if (chunk === previousChunk) return;
|
|
1476
1469
|
previousChunk = chunk;
|
|
1477
1470
|
}
|
|
1478
1471
|
}
|
|
1479
1472
|
/** @internal */
|
|
1480
|
-
_splitChunk(chunk,
|
|
1473
|
+
_splitChunk(chunk, index2) {
|
|
1481
1474
|
if (chunk.edited && chunk.content.length) {
|
|
1482
|
-
const loc = getLocator(this.original)(
|
|
1475
|
+
const loc = getLocator(this.original)(index2);
|
|
1483
1476
|
throw new MagicStringError(`cannot split a chunk that has already been edited (${loc.line}:${loc.column} \u2013 "${chunk.original}")`);
|
|
1484
1477
|
}
|
|
1485
|
-
const newChunk = chunk.split(
|
|
1486
|
-
this.byEnd.set(
|
|
1487
|
-
this.byStart.set(
|
|
1478
|
+
const newChunk = chunk.split(index2);
|
|
1479
|
+
this.byEnd.set(index2, chunk);
|
|
1480
|
+
this.byStart.set(index2, newChunk);
|
|
1488
1481
|
this.byEnd.set(newChunk.end, newChunk);
|
|
1489
1482
|
if (chunk === this.lastChunk) this.lastChunk = newChunk;
|
|
1490
1483
|
this.lastSearchedChunk = chunk;
|
|
@@ -1643,8 +1636,8 @@ var init_dist = __esm({
|
|
|
1643
1636
|
if (this._hasRemovedContent(match.index, match.index + match[0].length)) return false;
|
|
1644
1637
|
const replacement2 = getReplacement(match, this.original);
|
|
1645
1638
|
if (replacement2 === match[0]) return true;
|
|
1646
|
-
if (match[0].length === 0) this.appendRight(match.index, replacement2);
|
|
1647
|
-
else this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
1639
|
+
if (match[0].length === 0) this.appendRight(match.index - this.offset, replacement2);
|
|
1640
|
+
else this.overwrite(match.index - this.offset, match.index + match[0].length - this.offset, replacement2);
|
|
1648
1641
|
return true;
|
|
1649
1642
|
};
|
|
1650
1643
|
if (searchValue.global) {
|
|
@@ -1662,17 +1655,17 @@ var init_dist = __esm({
|
|
|
1662
1655
|
/** @internal */
|
|
1663
1656
|
_replaceString(string2, replacement) {
|
|
1664
1657
|
const { original } = this;
|
|
1665
|
-
let
|
|
1666
|
-
while (
|
|
1667
|
-
if (this._hasRemovedContent(
|
|
1668
|
-
|
|
1658
|
+
let index2 = original.indexOf(string2);
|
|
1659
|
+
while (index2 !== -1) {
|
|
1660
|
+
if (this._hasRemovedContent(index2, index2 + string2.length)) {
|
|
1661
|
+
index2 = original.indexOf(string2, index2 + string2.length);
|
|
1669
1662
|
continue;
|
|
1670
1663
|
}
|
|
1671
|
-
if (typeof replacement === "function") replacement = replacement(string2,
|
|
1672
|
-
else replacement = expandReplacement(replacement, string2,
|
|
1664
|
+
if (typeof replacement === "function") replacement = replacement(string2, index2, original);
|
|
1665
|
+
else replacement = expandReplacement(replacement, string2, index2, original, [], void 0);
|
|
1673
1666
|
if (string2 !== replacement) {
|
|
1674
|
-
if (string2.length === 0) this.appendRight(
|
|
1675
|
-
else this.overwrite(
|
|
1667
|
+
if (string2.length === 0) this.appendRight(index2 - this.offset, replacement);
|
|
1668
|
+
else this.overwrite(index2 - this.offset, index2 + string2.length - this.offset, replacement);
|
|
1676
1669
|
}
|
|
1677
1670
|
break;
|
|
1678
1671
|
}
|
|
@@ -1690,18 +1683,18 @@ var init_dist = __esm({
|
|
|
1690
1683
|
const { original } = this;
|
|
1691
1684
|
const stringLength = string2.length;
|
|
1692
1685
|
if (stringLength === 0) {
|
|
1693
|
-
for (let
|
|
1694
|
-
if (this._hasRemovedContent(
|
|
1695
|
-
const _replacement = typeof replacement === "function" ? replacement("",
|
|
1696
|
-
if (_replacement !== "") this.appendRight(
|
|
1686
|
+
for (let index2 = 0; index2 <= original.length; index2 += 1) {
|
|
1687
|
+
if (this._hasRemovedContent(index2, index2)) continue;
|
|
1688
|
+
const _replacement = typeof replacement === "function" ? replacement("", index2, original) : expandReplacement(replacement, "", index2, original, [], void 0);
|
|
1689
|
+
if (_replacement !== "") this.appendRight(index2 - this.offset, _replacement);
|
|
1697
1690
|
}
|
|
1698
1691
|
return this;
|
|
1699
1692
|
}
|
|
1700
|
-
for (let
|
|
1701
|
-
if (this._hasRemovedContent(
|
|
1702
|
-
const previous = original.slice(
|
|
1703
|
-
const _replacement = typeof replacement === "function" ? replacement(previous,
|
|
1704
|
-
if (previous !== _replacement) this.overwrite(
|
|
1693
|
+
for (let index2 = original.indexOf(string2); index2 !== -1; index2 = original.indexOf(string2, index2 + stringLength)) {
|
|
1694
|
+
if (this._hasRemovedContent(index2, index2 + stringLength)) continue;
|
|
1695
|
+
const previous = original.slice(index2, index2 + stringLength);
|
|
1696
|
+
const _replacement = typeof replacement === "function" ? replacement(previous, index2, original) : expandReplacement(replacement, previous, index2, original, [], void 0);
|
|
1697
|
+
if (previous !== _replacement) this.overwrite(index2 - this.offset, index2 + stringLength - this.offset, _replacement);
|
|
1705
1698
|
}
|
|
1706
1699
|
return this;
|
|
1707
1700
|
}
|
|
@@ -1839,7 +1832,7 @@ var init_dist = __esm({
|
|
|
1839
1832
|
sourceFirst.previous = last;
|
|
1840
1833
|
} else first = sourceFirst;
|
|
1841
1834
|
last = sourceLast;
|
|
1842
|
-
for (let
|
|
1835
|
+
for (let index2 = 0; index2 < magicString.original.length; index2 += 1) if (magicString.sourcemapLocations.has(index2)) combined.sourcemapLocations.add(index2 + offset);
|
|
1843
1836
|
Object.keys(magicString.storedNames).forEach((name) => {
|
|
1844
1837
|
Object.defineProperty(combined.storedNames, name, {
|
|
1845
1838
|
writable: true,
|
|
@@ -1941,8 +1934,8 @@ var init_dist = __esm({
|
|
|
1941
1934
|
if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
|
|
1942
1935
|
indentStringCounts[indentStr] += 1;
|
|
1943
1936
|
});
|
|
1944
|
-
return Object.keys(indentStringCounts).sort((
|
|
1945
|
-
return indentStringCounts[b2] - indentStringCounts[
|
|
1937
|
+
return Object.keys(indentStringCounts).sort((a, b2) => {
|
|
1938
|
+
return indentStringCounts[b2] - indentStringCounts[a];
|
|
1946
1939
|
})[0] || " ";
|
|
1947
1940
|
}
|
|
1948
1941
|
indent(indentStr) {
|
|
@@ -1958,8 +1951,8 @@ var init_dist = __esm({
|
|
|
1958
1951
|
});
|
|
1959
1952
|
trailingNewline = source.content.lastChar() === "\n";
|
|
1960
1953
|
});
|
|
1961
|
-
if (this.intro) this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match,
|
|
1962
|
-
return
|
|
1954
|
+
if (this.intro) this.intro = indentStr + this.intro.replace(/^[^\n]/gm, (match, index2) => {
|
|
1955
|
+
return index2 > 0 ? indentStr + match : match;
|
|
1963
1956
|
});
|
|
1964
1957
|
return this;
|
|
1965
1958
|
}
|
|
@@ -2024,104 +2017,109 @@ var init_dist = __esm({
|
|
|
2024
2017
|
}
|
|
2025
2018
|
});
|
|
2026
2019
|
|
|
2027
|
-
// node_modules/vitest/dist/chunks/tinyrainbow.
|
|
2028
|
-
var
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
green: [32, 39],
|
|
2040
|
-
yellow: [33, 39],
|
|
2041
|
-
blue: [34, 39],
|
|
2042
|
-
magenta: [35, 39],
|
|
2043
|
-
cyan: [36, 39],
|
|
2044
|
-
white: [37, 39],
|
|
2045
|
-
gray: [90, 39],
|
|
2046
|
-
bgBlack: [40, 49],
|
|
2047
|
-
bgRed: [41, 49],
|
|
2048
|
-
bgGreen: [42, 49],
|
|
2049
|
-
bgYellow: [43, 49],
|
|
2050
|
-
bgBlue: [44, 49],
|
|
2051
|
-
bgMagenta: [45, 49],
|
|
2052
|
-
bgCyan: [46, 49],
|
|
2053
|
-
bgWhite: [47, 49],
|
|
2054
|
-
blackBright: [90, 39],
|
|
2055
|
-
redBright: [91, 39],
|
|
2056
|
-
greenBright: [92, 39],
|
|
2057
|
-
yellowBright: [93, 39],
|
|
2058
|
-
blueBright: [94, 39],
|
|
2059
|
-
magentaBright: [95, 39],
|
|
2060
|
-
cyanBright: [96, 39],
|
|
2061
|
-
whiteBright: [97, 39],
|
|
2062
|
-
bgBlackBright: [100, 49],
|
|
2063
|
-
bgRedBright: [101, 49],
|
|
2064
|
-
bgGreenBright: [102, 49],
|
|
2065
|
-
bgYellowBright: [103, 49],
|
|
2066
|
-
bgBlueBright: [104, 49],
|
|
2067
|
-
bgMagentaBright: [105, 49],
|
|
2068
|
-
bgCyanBright: [106, 49],
|
|
2069
|
-
bgWhiteBright: [107, 49]
|
|
2020
|
+
// ../../node_modules/vitest/dist/chunks/tinyrainbow.Do8I1XRG.js
|
|
2021
|
+
var d = (e2) => String(e2);
|
|
2022
|
+
d.open = d.close = "";
|
|
2023
|
+
var i = () => d;
|
|
2024
|
+
var t = "\x1B[39m";
|
|
2025
|
+
var o = "\x1B[49m";
|
|
2026
|
+
var F = (e2, r, a, n2, l) => {
|
|
2027
|
+
let m2 = "", g2 = 0;
|
|
2028
|
+
do
|
|
2029
|
+
m2 += e2.substring(g2, n2) + a, g2 = n2 + l, n2 = e2.indexOf(r, g2);
|
|
2030
|
+
while (~n2);
|
|
2031
|
+
return m2 + e2.substring(g2);
|
|
2070
2032
|
};
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2033
|
+
var u = (e2, r, a = e2, n2 = e2.length) => {
|
|
2034
|
+
let l = r.length, m2 = (g2) => {
|
|
2035
|
+
let s = g2 + "", x = s.indexOf(r, n2);
|
|
2036
|
+
return ~x ? e2 + F(s, r, a, x, l) + r : e2 + s + r;
|
|
2037
|
+
};
|
|
2038
|
+
return m2.open = e2, m2.close = r, m2;
|
|
2039
|
+
};
|
|
2040
|
+
var B = (e2, r) => u(e2, r, e2, 5);
|
|
2041
|
+
var c = (e2) => {
|
|
2042
|
+
let r = e2.charCodeAt(0) === 35 ? e2.slice(1) : e2, a = parseInt(r, 16) || 0;
|
|
2043
|
+
return r.length < 6 ? `${(a >> 8 & 15) * 17};${(a >> 4 & 15) * 17};${(a & 15) * 17}` : `${a >> 16 & 255};${a >> 8 & 255};${a & 255}`;
|
|
2044
|
+
};
|
|
2045
|
+
function y(e2) {
|
|
2046
|
+
let r = e2 ? u : i;
|
|
2047
|
+
return {
|
|
2048
|
+
isColorSupported: e2,
|
|
2049
|
+
reset: r("\x1B[0m", "\x1B[0m"),
|
|
2050
|
+
bold: r("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
|
|
2051
|
+
dim: r("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
|
|
2052
|
+
italic: r("\x1B[3m", "\x1B[23m"),
|
|
2053
|
+
underline: r("\x1B[4m", "\x1B[24m"),
|
|
2054
|
+
inverse: r("\x1B[7m", "\x1B[27m"),
|
|
2055
|
+
hidden: r("\x1B[8m", "\x1B[28m"),
|
|
2056
|
+
strikethrough: r("\x1B[9m", "\x1B[29m"),
|
|
2057
|
+
black: r("\x1B[30m", t),
|
|
2058
|
+
red: r("\x1B[31m", t),
|
|
2059
|
+
green: r("\x1B[32m", t),
|
|
2060
|
+
yellow: r("\x1B[33m", t),
|
|
2061
|
+
blue: r("\x1B[34m", t),
|
|
2062
|
+
magenta: r("\x1B[35m", t),
|
|
2063
|
+
cyan: r("\x1B[36m", t),
|
|
2064
|
+
white: r("\x1B[37m", t),
|
|
2065
|
+
gray: r("\x1B[90m", t),
|
|
2066
|
+
bgBlack: r("\x1B[40m", o),
|
|
2067
|
+
bgRed: r("\x1B[41m", o),
|
|
2068
|
+
bgGreen: r("\x1B[42m", o),
|
|
2069
|
+
bgYellow: r("\x1B[43m", o),
|
|
2070
|
+
bgBlue: r("\x1B[44m", o),
|
|
2071
|
+
bgMagenta: r("\x1B[45m", o),
|
|
2072
|
+
bgCyan: r("\x1B[46m", o),
|
|
2073
|
+
bgWhite: r("\x1B[47m", o),
|
|
2074
|
+
blackBright: r("\x1B[90m", t),
|
|
2075
|
+
redBright: r("\x1B[91m", t),
|
|
2076
|
+
greenBright: r("\x1B[92m", t),
|
|
2077
|
+
yellowBright: r("\x1B[93m", t),
|
|
2078
|
+
blueBright: r("\x1B[94m", t),
|
|
2079
|
+
magentaBright: r("\x1B[95m", t),
|
|
2080
|
+
cyanBright: r("\x1B[96m", t),
|
|
2081
|
+
whiteBright: r("\x1B[97m", t),
|
|
2082
|
+
bgBlackBright: r("\x1B[100m", o),
|
|
2083
|
+
bgRedBright: r("\x1B[101m", o),
|
|
2084
|
+
bgGreenBright: r("\x1B[102m", o),
|
|
2085
|
+
bgYellowBright: r("\x1B[103m", o),
|
|
2086
|
+
bgBlueBright: r("\x1B[104m", o),
|
|
2087
|
+
bgMagentaBright: r("\x1B[105m", o),
|
|
2088
|
+
bgCyanBright: r("\x1B[106m", o),
|
|
2089
|
+
bgWhiteBright: r("\x1B[107m", o),
|
|
2090
|
+
rgb: e2 ? (n2, l, m2) => B(`\x1B[38;2;${n2};${l};${m2}m`, t) : i,
|
|
2091
|
+
bgRgb: e2 ? (n2, l, m2) => B(`\x1B[48;2;${n2};${l};${m2}m`, o) : i,
|
|
2092
|
+
hex: e2 ? (n2) => B(`\x1B[38;2;${c(n2)}m`, t) : i,
|
|
2093
|
+
bgHex: e2 ? (n2) => B(`\x1B[48;2;${c(n2)}m`, o) : i
|
|
2094
|
+
};
|
|
2095
|
+
}
|
|
2096
|
+
function C() {
|
|
2097
|
+
let e2 = typeof process != "undefined" ? process : void 0, r = (e2 == null ? void 0 : e2.env) || {}, a = r.FORCE_TTY !== "false", n2 = (e2 == null ? void 0 : e2.argv) || [];
|
|
2098
|
+
return !("NO_COLOR" in r || n2.includes("--no-color")) && ("FORCE_COLOR" in r || n2.includes("--color") || (e2 == null ? void 0 : e2.platform) === "win32" || a && r.TERM !== "dumb" || "CI" in r) || typeof window != "undefined" && !!window.chrome;
|
|
2099
|
+
}
|
|
2100
|
+
function h({ force: e2 } = {}) {
|
|
2101
|
+
let r = e2 || C();
|
|
2102
|
+
return y(r);
|
|
2103
|
+
}
|
|
2104
|
+
var b = h();
|
|
2105
|
+
var $ = b;
|
|
2108
2106
|
|
|
2109
|
-
// node_modules/vitest/dist/chunks/index.
|
|
2110
|
-
function _mergeNamespaces
|
|
2111
|
-
m2.forEach(function(
|
|
2112
|
-
|
|
2113
|
-
if (k !== "default" && !(k in
|
|
2114
|
-
var d2 = Object.getOwnPropertyDescriptor(
|
|
2115
|
-
Object.defineProperty(
|
|
2107
|
+
// ../../node_modules/vitest/dist/chunks/index.D0heQG4v.js
|
|
2108
|
+
function _mergeNamespaces(n2, m2) {
|
|
2109
|
+
m2.forEach(function(e2) {
|
|
2110
|
+
e2 && typeof e2 !== "string" && !Array.isArray(e2) && Object.keys(e2).forEach(function(k) {
|
|
2111
|
+
if (k !== "default" && !(k in n2)) {
|
|
2112
|
+
var d2 = Object.getOwnPropertyDescriptor(e2, k);
|
|
2113
|
+
Object.defineProperty(n2, k, d2.get ? d2 : {
|
|
2116
2114
|
enumerable: true,
|
|
2117
2115
|
get: function() {
|
|
2118
|
-
return
|
|
2116
|
+
return e2[k];
|
|
2119
2117
|
}
|
|
2120
2118
|
});
|
|
2121
2119
|
}
|
|
2122
2120
|
});
|
|
2123
2121
|
});
|
|
2124
|
-
return Object.freeze(
|
|
2122
|
+
return Object.freeze(n2);
|
|
2125
2123
|
}
|
|
2126
2124
|
function getKeysOfEnumerableProperties(object2, compareKeys) {
|
|
2127
2125
|
const rawKeys = Object.keys(object2);
|
|
@@ -2431,6 +2429,7 @@ var plugin$2 = {
|
|
|
2431
2429
|
serialize: serialize$2,
|
|
2432
2430
|
test: test$2
|
|
2433
2431
|
};
|
|
2432
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
2434
2433
|
function getDefaultExportFromCjs(x) {
|
|
2435
2434
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
2436
2435
|
}
|
|
@@ -2521,22 +2520,120 @@ function requireReactIs_production() {
|
|
|
2521
2520
|
return typeOf2(object2) === REACT_SUSPENSE_LIST_TYPE;
|
|
2522
2521
|
};
|
|
2523
2522
|
reactIs_production.isValidElementType = function(type3) {
|
|
2524
|
-
return "string" === typeof type3 || "function" === typeof type3 || type3 === REACT_FRAGMENT_TYPE || type3 === REACT_PROFILER_TYPE || type3 === REACT_STRICT_MODE_TYPE || type3 === REACT_SUSPENSE_TYPE || type3 === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type3 && null !== type3 && (type3.$$typeof === REACT_LAZY_TYPE || type3.$$typeof === REACT_MEMO_TYPE || type3.$$typeof === REACT_CONTEXT_TYPE || type3.$$typeof === REACT_CONSUMER_TYPE || type3.$$typeof === REACT_FORWARD_REF_TYPE || type3.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type3.getModuleId) ? true : false;
|
|
2523
|
+
return "string" === typeof type3 || "function" === typeof type3 || type3 === REACT_FRAGMENT_TYPE || type3 === REACT_PROFILER_TYPE || type3 === REACT_STRICT_MODE_TYPE || type3 === REACT_SUSPENSE_TYPE || type3 === REACT_SUSPENSE_LIST_TYPE || type3 === REACT_VIEW_TRANSITION_TYPE || "object" === typeof type3 && null !== type3 && (type3.$$typeof === REACT_LAZY_TYPE || type3.$$typeof === REACT_MEMO_TYPE || type3.$$typeof === REACT_CONTEXT_TYPE || type3.$$typeof === REACT_CONSUMER_TYPE || type3.$$typeof === REACT_FORWARD_REF_TYPE || type3.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type3.getModuleId) ? true : false;
|
|
2525
2524
|
};
|
|
2526
2525
|
reactIs_production.typeOf = typeOf2;
|
|
2527
2526
|
return reactIs_production;
|
|
2528
2527
|
}
|
|
2528
|
+
var reactIs_development$1 = {};
|
|
2529
|
+
var hasRequiredReactIs_development$1;
|
|
2530
|
+
function requireReactIs_development$1() {
|
|
2531
|
+
if (hasRequiredReactIs_development$1) return reactIs_development$1;
|
|
2532
|
+
hasRequiredReactIs_development$1 = 1;
|
|
2533
|
+
"production" !== process.env.NODE_ENV && (function() {
|
|
2534
|
+
function typeOf2(object2) {
|
|
2535
|
+
if ("object" === typeof object2 && null !== object2) {
|
|
2536
|
+
var $$typeof = object2.$$typeof;
|
|
2537
|
+
switch ($$typeof) {
|
|
2538
|
+
case REACT_ELEMENT_TYPE:
|
|
2539
|
+
switch (object2 = object2.type, object2) {
|
|
2540
|
+
case REACT_FRAGMENT_TYPE:
|
|
2541
|
+
case REACT_PROFILER_TYPE:
|
|
2542
|
+
case REACT_STRICT_MODE_TYPE:
|
|
2543
|
+
case REACT_SUSPENSE_TYPE:
|
|
2544
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
2545
|
+
case REACT_VIEW_TRANSITION_TYPE:
|
|
2546
|
+
return object2;
|
|
2547
|
+
default:
|
|
2548
|
+
switch (object2 = object2 && object2.$$typeof, object2) {
|
|
2549
|
+
case REACT_CONTEXT_TYPE:
|
|
2550
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2551
|
+
case REACT_LAZY_TYPE:
|
|
2552
|
+
case REACT_MEMO_TYPE:
|
|
2553
|
+
return object2;
|
|
2554
|
+
case REACT_CONSUMER_TYPE:
|
|
2555
|
+
return object2;
|
|
2556
|
+
default:
|
|
2557
|
+
return $$typeof;
|
|
2558
|
+
}
|
|
2559
|
+
}
|
|
2560
|
+
case REACT_PORTAL_TYPE:
|
|
2561
|
+
return $$typeof;
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
}
|
|
2565
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
2566
|
+
reactIs_development$1.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
2567
|
+
reactIs_development$1.ContextProvider = REACT_CONTEXT_TYPE;
|
|
2568
|
+
reactIs_development$1.Element = REACT_ELEMENT_TYPE;
|
|
2569
|
+
reactIs_development$1.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
2570
|
+
reactIs_development$1.Fragment = REACT_FRAGMENT_TYPE;
|
|
2571
|
+
reactIs_development$1.Lazy = REACT_LAZY_TYPE;
|
|
2572
|
+
reactIs_development$1.Memo = REACT_MEMO_TYPE;
|
|
2573
|
+
reactIs_development$1.Portal = REACT_PORTAL_TYPE;
|
|
2574
|
+
reactIs_development$1.Profiler = REACT_PROFILER_TYPE;
|
|
2575
|
+
reactIs_development$1.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2576
|
+
reactIs_development$1.Suspense = REACT_SUSPENSE_TYPE;
|
|
2577
|
+
reactIs_development$1.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
2578
|
+
reactIs_development$1.isContextConsumer = function(object2) {
|
|
2579
|
+
return typeOf2(object2) === REACT_CONSUMER_TYPE;
|
|
2580
|
+
};
|
|
2581
|
+
reactIs_development$1.isContextProvider = function(object2) {
|
|
2582
|
+
return typeOf2(object2) === REACT_CONTEXT_TYPE;
|
|
2583
|
+
};
|
|
2584
|
+
reactIs_development$1.isElement = function(object2) {
|
|
2585
|
+
return "object" === typeof object2 && null !== object2 && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
2586
|
+
};
|
|
2587
|
+
reactIs_development$1.isForwardRef = function(object2) {
|
|
2588
|
+
return typeOf2(object2) === REACT_FORWARD_REF_TYPE;
|
|
2589
|
+
};
|
|
2590
|
+
reactIs_development$1.isFragment = function(object2) {
|
|
2591
|
+
return typeOf2(object2) === REACT_FRAGMENT_TYPE;
|
|
2592
|
+
};
|
|
2593
|
+
reactIs_development$1.isLazy = function(object2) {
|
|
2594
|
+
return typeOf2(object2) === REACT_LAZY_TYPE;
|
|
2595
|
+
};
|
|
2596
|
+
reactIs_development$1.isMemo = function(object2) {
|
|
2597
|
+
return typeOf2(object2) === REACT_MEMO_TYPE;
|
|
2598
|
+
};
|
|
2599
|
+
reactIs_development$1.isPortal = function(object2) {
|
|
2600
|
+
return typeOf2(object2) === REACT_PORTAL_TYPE;
|
|
2601
|
+
};
|
|
2602
|
+
reactIs_development$1.isProfiler = function(object2) {
|
|
2603
|
+
return typeOf2(object2) === REACT_PROFILER_TYPE;
|
|
2604
|
+
};
|
|
2605
|
+
reactIs_development$1.isStrictMode = function(object2) {
|
|
2606
|
+
return typeOf2(object2) === REACT_STRICT_MODE_TYPE;
|
|
2607
|
+
};
|
|
2608
|
+
reactIs_development$1.isSuspense = function(object2) {
|
|
2609
|
+
return typeOf2(object2) === REACT_SUSPENSE_TYPE;
|
|
2610
|
+
};
|
|
2611
|
+
reactIs_development$1.isSuspenseList = function(object2) {
|
|
2612
|
+
return typeOf2(object2) === REACT_SUSPENSE_LIST_TYPE;
|
|
2613
|
+
};
|
|
2614
|
+
reactIs_development$1.isValidElementType = function(type3) {
|
|
2615
|
+
return "string" === typeof type3 || "function" === typeof type3 || type3 === REACT_FRAGMENT_TYPE || type3 === REACT_PROFILER_TYPE || type3 === REACT_STRICT_MODE_TYPE || type3 === REACT_SUSPENSE_TYPE || type3 === REACT_SUSPENSE_LIST_TYPE || type3 === REACT_VIEW_TRANSITION_TYPE || "object" === typeof type3 && null !== type3 && (type3.$$typeof === REACT_LAZY_TYPE || type3.$$typeof === REACT_MEMO_TYPE || type3.$$typeof === REACT_CONTEXT_TYPE || type3.$$typeof === REACT_CONSUMER_TYPE || type3.$$typeof === REACT_FORWARD_REF_TYPE || type3.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type3.getModuleId) ? true : false;
|
|
2616
|
+
};
|
|
2617
|
+
reactIs_development$1.typeOf = typeOf2;
|
|
2618
|
+
})();
|
|
2619
|
+
return reactIs_development$1;
|
|
2620
|
+
}
|
|
2529
2621
|
var hasRequiredReactIs$1;
|
|
2530
2622
|
function requireReactIs$1() {
|
|
2531
2623
|
if (hasRequiredReactIs$1) return reactIs$1.exports;
|
|
2532
2624
|
hasRequiredReactIs$1 = 1;
|
|
2533
|
-
|
|
2625
|
+
if (process.env.NODE_ENV === "production") {
|
|
2626
|
+
reactIs$1.exports = requireReactIs_production();
|
|
2627
|
+
} else {
|
|
2628
|
+
reactIs$1.exports = requireReactIs_development$1();
|
|
2629
|
+
}
|
|
2534
2630
|
return reactIs$1.exports;
|
|
2535
2631
|
}
|
|
2536
2632
|
var reactIsExports$1 = requireReactIs$1();
|
|
2537
|
-
var
|
|
2633
|
+
var index$1 = /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports$1);
|
|
2634
|
+
var ReactIs19 = /* @__PURE__ */ _mergeNamespaces({
|
|
2538
2635
|
__proto__: null,
|
|
2539
|
-
default:
|
|
2636
|
+
default: index$1
|
|
2540
2637
|
}, [reactIsExports$1]);
|
|
2541
2638
|
var reactIs = { exports: {} };
|
|
2542
2639
|
var reactIs_production_min = {};
|
|
@@ -2544,108 +2641,295 @@ var hasRequiredReactIs_production_min;
|
|
|
2544
2641
|
function requireReactIs_production_min() {
|
|
2545
2642
|
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
2546
2643
|
hasRequiredReactIs_production_min = 1;
|
|
2547
|
-
var b2 = Symbol.for("react.element"),
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2644
|
+
var b2 = Symbol.for("react.element"), c2 = Symbol.for("react.portal"), d2 = Symbol.for("react.fragment"), e2 = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g2 = Symbol.for("react.provider"), h3 = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m2 = Symbol.for("react.suspense"), n2 = Symbol.for("react.suspense_list"), p2 = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t3 = Symbol.for("react.offscreen"), u2;
|
|
2645
|
+
u2 = Symbol.for("react.module.reference");
|
|
2646
|
+
function v(a) {
|
|
2647
|
+
if ("object" === typeof a && null !== a) {
|
|
2648
|
+
var r = a.$$typeof;
|
|
2649
|
+
switch (r) {
|
|
2552
2650
|
case b2:
|
|
2553
|
-
switch (
|
|
2651
|
+
switch (a = a.type, a) {
|
|
2554
2652
|
case d2:
|
|
2555
2653
|
case f:
|
|
2556
|
-
case
|
|
2654
|
+
case e2:
|
|
2557
2655
|
case m2:
|
|
2558
|
-
case
|
|
2559
|
-
return
|
|
2656
|
+
case n2:
|
|
2657
|
+
return a;
|
|
2560
2658
|
default:
|
|
2561
|
-
switch (
|
|
2659
|
+
switch (a = a && a.$$typeof, a) {
|
|
2562
2660
|
case k:
|
|
2563
|
-
case
|
|
2661
|
+
case h3:
|
|
2564
2662
|
case l:
|
|
2565
2663
|
case q:
|
|
2566
|
-
case
|
|
2567
|
-
case
|
|
2568
|
-
return
|
|
2664
|
+
case p2:
|
|
2665
|
+
case g2:
|
|
2666
|
+
return a;
|
|
2569
2667
|
default:
|
|
2570
|
-
return
|
|
2668
|
+
return r;
|
|
2571
2669
|
}
|
|
2572
2670
|
}
|
|
2573
|
-
case
|
|
2574
|
-
return
|
|
2671
|
+
case c2:
|
|
2672
|
+
return r;
|
|
2575
2673
|
}
|
|
2576
2674
|
}
|
|
2577
2675
|
}
|
|
2578
|
-
reactIs_production_min.ContextConsumer =
|
|
2579
|
-
reactIs_production_min.ContextProvider =
|
|
2676
|
+
reactIs_production_min.ContextConsumer = h3;
|
|
2677
|
+
reactIs_production_min.ContextProvider = g2;
|
|
2580
2678
|
reactIs_production_min.Element = b2;
|
|
2581
2679
|
reactIs_production_min.ForwardRef = l;
|
|
2582
2680
|
reactIs_production_min.Fragment = d2;
|
|
2583
2681
|
reactIs_production_min.Lazy = q;
|
|
2584
|
-
reactIs_production_min.Memo =
|
|
2585
|
-
reactIs_production_min.Portal =
|
|
2682
|
+
reactIs_production_min.Memo = p2;
|
|
2683
|
+
reactIs_production_min.Portal = c2;
|
|
2586
2684
|
reactIs_production_min.Profiler = f;
|
|
2587
|
-
reactIs_production_min.StrictMode =
|
|
2685
|
+
reactIs_production_min.StrictMode = e2;
|
|
2588
2686
|
reactIs_production_min.Suspense = m2;
|
|
2589
|
-
reactIs_production_min.SuspenseList =
|
|
2687
|
+
reactIs_production_min.SuspenseList = n2;
|
|
2590
2688
|
reactIs_production_min.isAsyncMode = function() {
|
|
2591
2689
|
return false;
|
|
2592
2690
|
};
|
|
2593
2691
|
reactIs_production_min.isConcurrentMode = function() {
|
|
2594
2692
|
return false;
|
|
2595
2693
|
};
|
|
2596
|
-
reactIs_production_min.isContextConsumer = function(
|
|
2597
|
-
return v(
|
|
2694
|
+
reactIs_production_min.isContextConsumer = function(a) {
|
|
2695
|
+
return v(a) === h3;
|
|
2598
2696
|
};
|
|
2599
|
-
reactIs_production_min.isContextProvider = function(
|
|
2600
|
-
return v(
|
|
2697
|
+
reactIs_production_min.isContextProvider = function(a) {
|
|
2698
|
+
return v(a) === g2;
|
|
2601
2699
|
};
|
|
2602
|
-
reactIs_production_min.isElement = function(
|
|
2603
|
-
return "object" === typeof
|
|
2700
|
+
reactIs_production_min.isElement = function(a) {
|
|
2701
|
+
return "object" === typeof a && null !== a && a.$$typeof === b2;
|
|
2604
2702
|
};
|
|
2605
|
-
reactIs_production_min.isForwardRef = function(
|
|
2606
|
-
return v(
|
|
2703
|
+
reactIs_production_min.isForwardRef = function(a) {
|
|
2704
|
+
return v(a) === l;
|
|
2607
2705
|
};
|
|
2608
|
-
reactIs_production_min.isFragment = function(
|
|
2609
|
-
return v(
|
|
2706
|
+
reactIs_production_min.isFragment = function(a) {
|
|
2707
|
+
return v(a) === d2;
|
|
2610
2708
|
};
|
|
2611
|
-
reactIs_production_min.isLazy = function(
|
|
2612
|
-
return v(
|
|
2709
|
+
reactIs_production_min.isLazy = function(a) {
|
|
2710
|
+
return v(a) === q;
|
|
2613
2711
|
};
|
|
2614
|
-
reactIs_production_min.isMemo = function(
|
|
2615
|
-
return v(
|
|
2712
|
+
reactIs_production_min.isMemo = function(a) {
|
|
2713
|
+
return v(a) === p2;
|
|
2616
2714
|
};
|
|
2617
|
-
reactIs_production_min.isPortal = function(
|
|
2618
|
-
return v(
|
|
2715
|
+
reactIs_production_min.isPortal = function(a) {
|
|
2716
|
+
return v(a) === c2;
|
|
2619
2717
|
};
|
|
2620
|
-
reactIs_production_min.isProfiler = function(
|
|
2621
|
-
return v(
|
|
2718
|
+
reactIs_production_min.isProfiler = function(a) {
|
|
2719
|
+
return v(a) === f;
|
|
2622
2720
|
};
|
|
2623
|
-
reactIs_production_min.isStrictMode = function(
|
|
2624
|
-
return v(
|
|
2721
|
+
reactIs_production_min.isStrictMode = function(a) {
|
|
2722
|
+
return v(a) === e2;
|
|
2625
2723
|
};
|
|
2626
|
-
reactIs_production_min.isSuspense = function(
|
|
2627
|
-
return v(
|
|
2724
|
+
reactIs_production_min.isSuspense = function(a) {
|
|
2725
|
+
return v(a) === m2;
|
|
2628
2726
|
};
|
|
2629
|
-
reactIs_production_min.isSuspenseList = function(
|
|
2630
|
-
return v(
|
|
2727
|
+
reactIs_production_min.isSuspenseList = function(a) {
|
|
2728
|
+
return v(a) === n2;
|
|
2631
2729
|
};
|
|
2632
|
-
reactIs_production_min.isValidElementType = function(
|
|
2633
|
-
return "string" === typeof
|
|
2730
|
+
reactIs_production_min.isValidElementType = function(a) {
|
|
2731
|
+
return "string" === typeof a || "function" === typeof a || a === d2 || a === f || a === e2 || a === m2 || a === n2 || a === t3 || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p2 || a.$$typeof === g2 || a.$$typeof === h3 || a.$$typeof === l || a.$$typeof === u2 || void 0 !== a.getModuleId) ? true : false;
|
|
2634
2732
|
};
|
|
2635
2733
|
reactIs_production_min.typeOf = v;
|
|
2636
2734
|
return reactIs_production_min;
|
|
2637
2735
|
}
|
|
2736
|
+
var reactIs_development = {};
|
|
2737
|
+
var hasRequiredReactIs_development;
|
|
2738
|
+
function requireReactIs_development() {
|
|
2739
|
+
if (hasRequiredReactIs_development) return reactIs_development;
|
|
2740
|
+
hasRequiredReactIs_development = 1;
|
|
2741
|
+
if (process.env.NODE_ENV !== "production") {
|
|
2742
|
+
(function() {
|
|
2743
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
2744
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
2745
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
2746
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
2747
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
2748
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
2749
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
2750
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
|
2751
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
2752
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
2753
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
2754
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
2755
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
2756
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
2757
|
+
var enableScopeAPI = false;
|
|
2758
|
+
var enableCacheElement = false;
|
|
2759
|
+
var enableTransitionTracing = false;
|
|
2760
|
+
var enableLegacyHidden = false;
|
|
2761
|
+
var enableDebugTracing = false;
|
|
2762
|
+
var REACT_MODULE_REFERENCE;
|
|
2763
|
+
{
|
|
2764
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
2765
|
+
}
|
|
2766
|
+
function isValidElementType(type3) {
|
|
2767
|
+
if (typeof type3 === "string" || typeof type3 === "function") {
|
|
2768
|
+
return true;
|
|
2769
|
+
}
|
|
2770
|
+
if (type3 === REACT_FRAGMENT_TYPE || type3 === REACT_PROFILER_TYPE || enableDebugTracing || type3 === REACT_STRICT_MODE_TYPE || type3 === REACT_SUSPENSE_TYPE || type3 === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type3 === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
|
|
2771
|
+
return true;
|
|
2772
|
+
}
|
|
2773
|
+
if (typeof type3 === "object" && type3 !== null) {
|
|
2774
|
+
if (type3.$$typeof === REACT_LAZY_TYPE || type3.$$typeof === REACT_MEMO_TYPE || type3.$$typeof === REACT_PROVIDER_TYPE || type3.$$typeof === REACT_CONTEXT_TYPE || type3.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
2775
|
+
// types supported by any Flight configuration anywhere since
|
|
2776
|
+
// we don't know which Flight build this will end up being used
|
|
2777
|
+
// with.
|
|
2778
|
+
type3.$$typeof === REACT_MODULE_REFERENCE || type3.getModuleId !== void 0) {
|
|
2779
|
+
return true;
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
return false;
|
|
2783
|
+
}
|
|
2784
|
+
function typeOf2(object2) {
|
|
2785
|
+
if (typeof object2 === "object" && object2 !== null) {
|
|
2786
|
+
var $$typeof = object2.$$typeof;
|
|
2787
|
+
switch ($$typeof) {
|
|
2788
|
+
case REACT_ELEMENT_TYPE:
|
|
2789
|
+
var type3 = object2.type;
|
|
2790
|
+
switch (type3) {
|
|
2791
|
+
case REACT_FRAGMENT_TYPE:
|
|
2792
|
+
case REACT_PROFILER_TYPE:
|
|
2793
|
+
case REACT_STRICT_MODE_TYPE:
|
|
2794
|
+
case REACT_SUSPENSE_TYPE:
|
|
2795
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
2796
|
+
return type3;
|
|
2797
|
+
default:
|
|
2798
|
+
var $$typeofType = type3 && type3.$$typeof;
|
|
2799
|
+
switch ($$typeofType) {
|
|
2800
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
2801
|
+
case REACT_CONTEXT_TYPE:
|
|
2802
|
+
case REACT_FORWARD_REF_TYPE:
|
|
2803
|
+
case REACT_LAZY_TYPE:
|
|
2804
|
+
case REACT_MEMO_TYPE:
|
|
2805
|
+
case REACT_PROVIDER_TYPE:
|
|
2806
|
+
return $$typeofType;
|
|
2807
|
+
default:
|
|
2808
|
+
return $$typeof;
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
case REACT_PORTAL_TYPE:
|
|
2812
|
+
return $$typeof;
|
|
2813
|
+
}
|
|
2814
|
+
}
|
|
2815
|
+
return void 0;
|
|
2816
|
+
}
|
|
2817
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
2818
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
2819
|
+
var Element2 = REACT_ELEMENT_TYPE;
|
|
2820
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
2821
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
2822
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
2823
|
+
var Memo = REACT_MEMO_TYPE;
|
|
2824
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
2825
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
2826
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2827
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
2828
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
2829
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
2830
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
2831
|
+
function isAsyncMode(object2) {
|
|
2832
|
+
{
|
|
2833
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
2834
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
2835
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
return false;
|
|
2839
|
+
}
|
|
2840
|
+
function isConcurrentMode(object2) {
|
|
2841
|
+
{
|
|
2842
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
2843
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
2844
|
+
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
2845
|
+
}
|
|
2846
|
+
}
|
|
2847
|
+
return false;
|
|
2848
|
+
}
|
|
2849
|
+
function isContextConsumer(object2) {
|
|
2850
|
+
return typeOf2(object2) === REACT_CONTEXT_TYPE;
|
|
2851
|
+
}
|
|
2852
|
+
function isContextProvider(object2) {
|
|
2853
|
+
return typeOf2(object2) === REACT_PROVIDER_TYPE;
|
|
2854
|
+
}
|
|
2855
|
+
function isElement(object2) {
|
|
2856
|
+
return typeof object2 === "object" && object2 !== null && object2.$$typeof === REACT_ELEMENT_TYPE;
|
|
2857
|
+
}
|
|
2858
|
+
function isForwardRef(object2) {
|
|
2859
|
+
return typeOf2(object2) === REACT_FORWARD_REF_TYPE;
|
|
2860
|
+
}
|
|
2861
|
+
function isFragment(object2) {
|
|
2862
|
+
return typeOf2(object2) === REACT_FRAGMENT_TYPE;
|
|
2863
|
+
}
|
|
2864
|
+
function isLazy(object2) {
|
|
2865
|
+
return typeOf2(object2) === REACT_LAZY_TYPE;
|
|
2866
|
+
}
|
|
2867
|
+
function isMemo(object2) {
|
|
2868
|
+
return typeOf2(object2) === REACT_MEMO_TYPE;
|
|
2869
|
+
}
|
|
2870
|
+
function isPortal(object2) {
|
|
2871
|
+
return typeOf2(object2) === REACT_PORTAL_TYPE;
|
|
2872
|
+
}
|
|
2873
|
+
function isProfiler(object2) {
|
|
2874
|
+
return typeOf2(object2) === REACT_PROFILER_TYPE;
|
|
2875
|
+
}
|
|
2876
|
+
function isStrictMode(object2) {
|
|
2877
|
+
return typeOf2(object2) === REACT_STRICT_MODE_TYPE;
|
|
2878
|
+
}
|
|
2879
|
+
function isSuspense(object2) {
|
|
2880
|
+
return typeOf2(object2) === REACT_SUSPENSE_TYPE;
|
|
2881
|
+
}
|
|
2882
|
+
function isSuspenseList(object2) {
|
|
2883
|
+
return typeOf2(object2) === REACT_SUSPENSE_LIST_TYPE;
|
|
2884
|
+
}
|
|
2885
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
2886
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
2887
|
+
reactIs_development.Element = Element2;
|
|
2888
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
2889
|
+
reactIs_development.Fragment = Fragment;
|
|
2890
|
+
reactIs_development.Lazy = Lazy;
|
|
2891
|
+
reactIs_development.Memo = Memo;
|
|
2892
|
+
reactIs_development.Portal = Portal;
|
|
2893
|
+
reactIs_development.Profiler = Profiler;
|
|
2894
|
+
reactIs_development.StrictMode = StrictMode;
|
|
2895
|
+
reactIs_development.Suspense = Suspense;
|
|
2896
|
+
reactIs_development.SuspenseList = SuspenseList;
|
|
2897
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
2898
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
2899
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
2900
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
2901
|
+
reactIs_development.isElement = isElement;
|
|
2902
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
2903
|
+
reactIs_development.isFragment = isFragment;
|
|
2904
|
+
reactIs_development.isLazy = isLazy;
|
|
2905
|
+
reactIs_development.isMemo = isMemo;
|
|
2906
|
+
reactIs_development.isPortal = isPortal;
|
|
2907
|
+
reactIs_development.isProfiler = isProfiler;
|
|
2908
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
2909
|
+
reactIs_development.isSuspense = isSuspense;
|
|
2910
|
+
reactIs_development.isSuspenseList = isSuspenseList;
|
|
2911
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
2912
|
+
reactIs_development.typeOf = typeOf2;
|
|
2913
|
+
})();
|
|
2914
|
+
}
|
|
2915
|
+
return reactIs_development;
|
|
2916
|
+
}
|
|
2638
2917
|
var hasRequiredReactIs;
|
|
2639
2918
|
function requireReactIs() {
|
|
2640
2919
|
if (hasRequiredReactIs) return reactIs.exports;
|
|
2641
2920
|
hasRequiredReactIs = 1;
|
|
2642
|
-
|
|
2921
|
+
if (process.env.NODE_ENV === "production") {
|
|
2922
|
+
reactIs.exports = requireReactIs_production_min();
|
|
2923
|
+
} else {
|
|
2924
|
+
reactIs.exports = requireReactIs_development();
|
|
2925
|
+
}
|
|
2643
2926
|
return reactIs.exports;
|
|
2644
2927
|
}
|
|
2645
2928
|
var reactIsExports = requireReactIs();
|
|
2646
|
-
var
|
|
2929
|
+
var index = /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports);
|
|
2930
|
+
var ReactIs18 = /* @__PURE__ */ _mergeNamespaces({
|
|
2647
2931
|
__proto__: null,
|
|
2648
|
-
default:
|
|
2932
|
+
default: index
|
|
2649
2933
|
}, [reactIsExports]);
|
|
2650
2934
|
var ReactIs = Object.fromEntries([
|
|
2651
2935
|
"isAsyncMode",
|
|
@@ -2744,7 +3028,7 @@ function printFunction(val, printFunctionName2) {
|
|
|
2744
3028
|
return `[Function ${val.name || "anonymous"}]`;
|
|
2745
3029
|
}
|
|
2746
3030
|
function printSymbol(val) {
|
|
2747
|
-
return
|
|
3031
|
+
return Symbol.prototype.toString.call(val).replace(SYMBOL_REGEXP, "Symbol($1)");
|
|
2748
3032
|
}
|
|
2749
3033
|
function printError(val) {
|
|
2750
3034
|
return `[${errorToString.call(val)}]`;
|
|
@@ -2842,7 +3126,7 @@ function findPlugin(plugins2, val) {
|
|
|
2842
3126
|
return null;
|
|
2843
3127
|
}
|
|
2844
3128
|
function printer(val, config2, indentation, depth, refs, hasCalledToJSON) {
|
|
2845
|
-
var
|
|
3129
|
+
var _a;
|
|
2846
3130
|
let result;
|
|
2847
3131
|
const plugin3 = findPlugin(config2.plugins, val);
|
|
2848
3132
|
if (plugin3 !== null) result = printPlugin(plugin3, val, config2, indentation, depth, refs);
|
|
@@ -2851,7 +3135,7 @@ function printer(val, config2, indentation, depth, refs, hasCalledToJSON) {
|
|
|
2851
3135
|
if (basicResult !== null) result = basicResult;
|
|
2852
3136
|
else result = printComplexValue(val, config2, indentation, depth, refs, hasCalledToJSON);
|
|
2853
3137
|
}
|
|
2854
|
-
(
|
|
3138
|
+
(_a = config2._outputLengthPerDepth)[depth] ?? (_a[depth] = 0);
|
|
2855
3139
|
config2._outputLengthPerDepth[depth] += result.length;
|
|
2856
3140
|
if (config2._outputLengthPerDepth[depth] > config2.maxOutputLength) config2.maxDepth = 0;
|
|
2857
3141
|
return result;
|
|
@@ -2894,7 +3178,7 @@ function validateOptions(options) {
|
|
|
2894
3178
|
function getColorsHighlight() {
|
|
2895
3179
|
return DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
2896
3180
|
const value = DEFAULT_THEME[key];
|
|
2897
|
-
const color = value &&
|
|
3181
|
+
const color = value && $[value];
|
|
2898
3182
|
if (color && typeof color.close === "string" && typeof color.open === "string") colors[key] = color;
|
|
2899
3183
|
else throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
|
|
2900
3184
|
return colors;
|
|
@@ -2963,7 +3247,7 @@ var plugins = {
|
|
|
2963
3247
|
Error: ErrorPlugin
|
|
2964
3248
|
};
|
|
2965
3249
|
|
|
2966
|
-
// node_modules/vitest/dist/chunks/display.
|
|
3250
|
+
// ../../node_modules/vitest/dist/chunks/display.BlTmubjj.js
|
|
2967
3251
|
var { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins;
|
|
2968
3252
|
var PLUGINS = [
|
|
2969
3253
|
ReactTestComponent,
|
|
@@ -3149,7 +3433,7 @@ function isHighSurrogate(char) {
|
|
|
3149
3433
|
return char >= "\uD800" && char <= "\uDBFF";
|
|
3150
3434
|
}
|
|
3151
3435
|
|
|
3152
|
-
// node_modules/vitest/dist/chunks/pathe.M-eThtNZ.
|
|
3436
|
+
// ../../node_modules/vitest/dist/chunks/pathe.M-eThtNZ.Ba-7h1rE.js
|
|
3153
3437
|
var KNOWN_ASSET_TYPES = [
|
|
3154
3438
|
"apng",
|
|
3155
3439
|
"bmp",
|
|
@@ -3184,7 +3468,7 @@ function createSimpleStackTrace(options) {
|
|
|
3184
3468
|
const limit = Error.stackTraceLimit;
|
|
3185
3469
|
const prepareStackTrace = Error.prepareStackTrace;
|
|
3186
3470
|
Error.stackTraceLimit = stackTraceLimit;
|
|
3187
|
-
Error.prepareStackTrace = (
|
|
3471
|
+
Error.prepareStackTrace = (e2) => e2.stack;
|
|
3188
3472
|
const stackTrace = new Error(message).stack || "";
|
|
3189
3473
|
Error.prepareStackTrace = prepareStackTrace;
|
|
3190
3474
|
Error.stackTraceLimit = limit;
|
|
@@ -3207,11 +3491,13 @@ function filterOutComments(s) {
|
|
|
3207
3491
|
if (s[i3] === "\n") commentState = "none";
|
|
3208
3492
|
} else if (commentState === "multiline") {
|
|
3209
3493
|
if (s[i3 - 1] === "*" && s[i3] === "/") commentState = "none";
|
|
3210
|
-
} else if (commentState === "none")
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3494
|
+
} else if (commentState === "none") {
|
|
3495
|
+
if (s[i3] === "/" && s[i3 + 1] === "/") commentState = "singleline";
|
|
3496
|
+
else if (s[i3] === "/" && s[i3 + 1] === "*") {
|
|
3497
|
+
commentState = "multiline";
|
|
3498
|
+
i3 += 2;
|
|
3499
|
+
} else result.push(s[i3]);
|
|
3500
|
+
}
|
|
3215
3501
|
return result.join("");
|
|
3216
3502
|
}
|
|
3217
3503
|
function toArray(array2) {
|
|
@@ -3286,8 +3572,8 @@ function noop() {
|
|
|
3286
3572
|
function objectAttr(source, path, defaultValue = void 0) {
|
|
3287
3573
|
const paths = path.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
3288
3574
|
let result = source;
|
|
3289
|
-
for (const
|
|
3290
|
-
result = new Object(result)[
|
|
3575
|
+
for (const p2 of paths) {
|
|
3576
|
+
result = new Object(result)[p2];
|
|
3291
3577
|
if (result === void 0) return defaultValue;
|
|
3292
3578
|
}
|
|
3293
3579
|
return result;
|
|
@@ -3295,13 +3581,13 @@ function objectAttr(source, path, defaultValue = void 0) {
|
|
|
3295
3581
|
function createDefer() {
|
|
3296
3582
|
let resolve2 = null;
|
|
3297
3583
|
let reject = null;
|
|
3298
|
-
const
|
|
3584
|
+
const p2 = new Promise((_resolve, _reject) => {
|
|
3299
3585
|
resolve2 = _resolve;
|
|
3300
3586
|
reject = _reject;
|
|
3301
3587
|
});
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
return
|
|
3588
|
+
p2.resolve = resolve2;
|
|
3589
|
+
p2.reject = reject;
|
|
3590
|
+
return p2;
|
|
3305
3591
|
}
|
|
3306
3592
|
function getCallLastIndex(code) {
|
|
3307
3593
|
let charIndex = -1;
|
|
@@ -3347,7 +3633,7 @@ function normalizeWindowsPath(input = "") {
|
|
|
3347
3633
|
if (!input) {
|
|
3348
3634
|
return input;
|
|
3349
3635
|
}
|
|
3350
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (
|
|
3636
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
3351
3637
|
}
|
|
3352
3638
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
3353
3639
|
function cwd() {
|
|
@@ -3360,8 +3646,8 @@ var resolve = function(...arguments_) {
|
|
|
3360
3646
|
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
3361
3647
|
let resolvedPath = "";
|
|
3362
3648
|
let resolvedAbsolute = false;
|
|
3363
|
-
for (let
|
|
3364
|
-
const path =
|
|
3649
|
+
for (let index2 = arguments_.length - 1; index2 >= -1 && !resolvedAbsolute; index2--) {
|
|
3650
|
+
const path = index2 >= 0 ? arguments_[index2] : cwd();
|
|
3365
3651
|
if (!path || path.length === 0) {
|
|
3366
3652
|
continue;
|
|
3367
3653
|
}
|
|
@@ -3380,16 +3666,16 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
3380
3666
|
let lastSlash = -1;
|
|
3381
3667
|
let dots = 0;
|
|
3382
3668
|
let char = null;
|
|
3383
|
-
for (let
|
|
3384
|
-
if (
|
|
3385
|
-
char = path[
|
|
3669
|
+
for (let index2 = 0; index2 <= path.length; ++index2) {
|
|
3670
|
+
if (index2 < path.length) {
|
|
3671
|
+
char = path[index2];
|
|
3386
3672
|
} else if (char === "/") {
|
|
3387
3673
|
break;
|
|
3388
3674
|
} else {
|
|
3389
3675
|
char = "/";
|
|
3390
3676
|
}
|
|
3391
3677
|
if (char === "/") {
|
|
3392
|
-
if (lastSlash ===
|
|
3678
|
+
if (lastSlash === index2 - 1 || dots === 1) ;
|
|
3393
3679
|
else if (dots === 2) {
|
|
3394
3680
|
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
3395
3681
|
if (res.length > 2) {
|
|
@@ -3401,13 +3687,13 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
3401
3687
|
res = res.slice(0, lastSlashIndex);
|
|
3402
3688
|
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
3403
3689
|
}
|
|
3404
|
-
lastSlash =
|
|
3690
|
+
lastSlash = index2;
|
|
3405
3691
|
dots = 0;
|
|
3406
3692
|
continue;
|
|
3407
3693
|
} else if (res.length > 0) {
|
|
3408
3694
|
res = "";
|
|
3409
3695
|
lastSegmentLength = 0;
|
|
3410
|
-
lastSlash =
|
|
3696
|
+
lastSlash = index2;
|
|
3411
3697
|
dots = 0;
|
|
3412
3698
|
continue;
|
|
3413
3699
|
}
|
|
@@ -3418,13 +3704,13 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
3418
3704
|
}
|
|
3419
3705
|
} else {
|
|
3420
3706
|
if (res.length > 0) {
|
|
3421
|
-
res += `/${path.slice(lastSlash + 1,
|
|
3707
|
+
res += `/${path.slice(lastSlash + 1, index2)}`;
|
|
3422
3708
|
} else {
|
|
3423
|
-
res = path.slice(lastSlash + 1,
|
|
3709
|
+
res = path.slice(lastSlash + 1, index2);
|
|
3424
3710
|
}
|
|
3425
|
-
lastSegmentLength =
|
|
3711
|
+
lastSegmentLength = index2 - lastSlash - 1;
|
|
3426
3712
|
}
|
|
3427
|
-
lastSlash =
|
|
3713
|
+
lastSlash = index2;
|
|
3428
3714
|
dots = 0;
|
|
3429
3715
|
} else if (char === "." && dots !== -1) {
|
|
3430
3716
|
++dots;
|
|
@@ -3434,15 +3720,11 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
3434
3720
|
}
|
|
3435
3721
|
return res;
|
|
3436
3722
|
}
|
|
3437
|
-
var isAbsolute = function(
|
|
3438
|
-
return _IS_ABSOLUTE_RE.test(
|
|
3723
|
+
var isAbsolute = function(p2) {
|
|
3724
|
+
return _IS_ABSOLUTE_RE.test(p2);
|
|
3439
3725
|
};
|
|
3440
3726
|
|
|
3441
|
-
// node_modules/vitest/dist/chunks/source-map.
|
|
3442
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3443
|
-
function getDefaultExportFromCjs2(x) {
|
|
3444
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
3445
|
-
}
|
|
3727
|
+
// ../../node_modules/vitest/dist/chunks/source-map.DdKI5IHB.js
|
|
3446
3728
|
var build = {};
|
|
3447
3729
|
var hasRequiredBuild;
|
|
3448
3730
|
function requireBuild() {
|
|
@@ -3925,7 +4207,7 @@ function requireBuild() {
|
|
|
3925
4207
|
return build;
|
|
3926
4208
|
}
|
|
3927
4209
|
var buildExports = requireBuild();
|
|
3928
|
-
var diffSequences = /* @__PURE__ */
|
|
4210
|
+
var diffSequences = /* @__PURE__ */ getDefaultExportFromCjs(buildExports);
|
|
3929
4211
|
var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
3930
4212
|
var IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
3931
4213
|
function isImmutable(v) {
|
|
@@ -3962,9 +4244,9 @@ function serializeValue(val, seen = /* @__PURE__ */ new WeakMap()) {
|
|
|
3962
4244
|
if (Array.isArray(val)) {
|
|
3963
4245
|
const clone2 = new Array(val.length);
|
|
3964
4246
|
seen.set(val, clone2);
|
|
3965
|
-
val.forEach((
|
|
4247
|
+
val.forEach((e2, i3) => {
|
|
3966
4248
|
try {
|
|
3967
|
-
clone2[i3] = serializeValue(
|
|
4249
|
+
clone2[i3] = serializeValue(e2, seen);
|
|
3968
4250
|
} catch (err) {
|
|
3969
4251
|
clone2[i3] = getUnserializableMessage(err);
|
|
3970
4252
|
}
|
|
@@ -4022,17 +4304,17 @@ var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
|
4022
4304
|
var intToChar = new Uint8Array(64);
|
|
4023
4305
|
var charToInt = new Uint8Array(128);
|
|
4024
4306
|
for (let i3 = 0; i3 < chars.length; i3++) {
|
|
4025
|
-
const
|
|
4026
|
-
intToChar[i3] =
|
|
4027
|
-
charToInt[
|
|
4307
|
+
const c2 = chars.charCodeAt(i3);
|
|
4308
|
+
intToChar[i3] = c2;
|
|
4309
|
+
charToInt[c2] = i3;
|
|
4028
4310
|
}
|
|
4029
4311
|
function decodeInteger(reader, relative2) {
|
|
4030
4312
|
let value = 0;
|
|
4031
4313
|
let shift = 0;
|
|
4032
4314
|
let integer = 0;
|
|
4033
4315
|
do {
|
|
4034
|
-
const
|
|
4035
|
-
integer = charToInt[
|
|
4316
|
+
const c2 = reader.next();
|
|
4317
|
+
integer = charToInt[c2];
|
|
4036
4318
|
value |= (integer & 31) << shift;
|
|
4037
4319
|
shift += 5;
|
|
4038
4320
|
} while (integer & 32);
|
|
@@ -4109,8 +4391,8 @@ function decode(mappings) {
|
|
|
4109
4391
|
function sort(line) {
|
|
4110
4392
|
line.sort(sortComparator$1);
|
|
4111
4393
|
}
|
|
4112
|
-
function sortComparator$1(
|
|
4113
|
-
return
|
|
4394
|
+
function sortComparator$1(a, b2) {
|
|
4395
|
+
return a[0] - b2[0];
|
|
4114
4396
|
}
|
|
4115
4397
|
var COLUMN = 0;
|
|
4116
4398
|
var SOURCES_INDEX = 1;
|
|
@@ -4135,17 +4417,17 @@ function binarySearch2(haystack, needle, low, high) {
|
|
|
4135
4417
|
found = false;
|
|
4136
4418
|
return low - 1;
|
|
4137
4419
|
}
|
|
4138
|
-
function upperBound(haystack, needle,
|
|
4139
|
-
for (let i3 =
|
|
4420
|
+
function upperBound(haystack, needle, index2) {
|
|
4421
|
+
for (let i3 = index2 + 1; i3 < haystack.length; index2 = i3++) {
|
|
4140
4422
|
if (haystack[i3][COLUMN] !== needle) break;
|
|
4141
4423
|
}
|
|
4142
|
-
return
|
|
4424
|
+
return index2;
|
|
4143
4425
|
}
|
|
4144
|
-
function lowerBound(haystack, needle,
|
|
4145
|
-
for (let i3 =
|
|
4426
|
+
function lowerBound(haystack, needle, index2) {
|
|
4427
|
+
for (let i3 = index2 - 1; i3 >= 0; index2 = i3--) {
|
|
4146
4428
|
if (haystack[i3][COLUMN] !== needle) break;
|
|
4147
4429
|
}
|
|
4148
|
-
return
|
|
4430
|
+
return index2;
|
|
4149
4431
|
}
|
|
4150
4432
|
function memoizedBinarySearch(haystack, needle, state, key) {
|
|
4151
4433
|
const { lastKey, lastNeedle, lastIndex } = state;
|
|
@@ -4174,8 +4456,8 @@ function cast(map2) {
|
|
|
4174
4456
|
return map2;
|
|
4175
4457
|
}
|
|
4176
4458
|
function decodedMappings(map2) {
|
|
4177
|
-
var
|
|
4178
|
-
return (
|
|
4459
|
+
var _a;
|
|
4460
|
+
return (_a = cast(map2))._decoded || (_a._decoded = decode(cast(map2)._encoded));
|
|
4179
4461
|
}
|
|
4180
4462
|
function originalPositionFor(map2, needle) {
|
|
4181
4463
|
let { line, column, bias } = needle;
|
|
@@ -4185,15 +4467,15 @@ function originalPositionFor(map2, needle) {
|
|
|
4185
4467
|
const decoded = decodedMappings(map2);
|
|
4186
4468
|
if (line >= decoded.length) return OMapping(null, null, null, null);
|
|
4187
4469
|
const segments = decoded[line];
|
|
4188
|
-
const
|
|
4470
|
+
const index2 = traceSegmentInternal(
|
|
4189
4471
|
segments,
|
|
4190
4472
|
cast(map2)._decodedMemo,
|
|
4191
4473
|
line,
|
|
4192
4474
|
column,
|
|
4193
4475
|
bias || GREATEST_LOWER_BOUND
|
|
4194
4476
|
);
|
|
4195
|
-
if (
|
|
4196
|
-
const segment = segments[
|
|
4477
|
+
if (index2 === -1) return OMapping(null, null, null, null);
|
|
4478
|
+
const segment = segments[index2];
|
|
4197
4479
|
if (segment.length === 1) return OMapping(null, null, null, null);
|
|
4198
4480
|
const { names, resolvedSources } = map2;
|
|
4199
4481
|
return OMapping(
|
|
@@ -4207,12 +4489,12 @@ function OMapping(source, line, column, name) {
|
|
|
4207
4489
|
return { source, line, column, name };
|
|
4208
4490
|
}
|
|
4209
4491
|
function traceSegmentInternal(segments, memo2, line, column, bias) {
|
|
4210
|
-
let
|
|
4492
|
+
let index2 = memoizedBinarySearch(segments, column, memo2, line);
|
|
4211
4493
|
if (found) {
|
|
4212
|
-
|
|
4213
|
-
} else if (bias === LEAST_UPPER_BOUND)
|
|
4214
|
-
if (
|
|
4215
|
-
return
|
|
4494
|
+
index2 = (bias === LEAST_UPPER_BOUND ? upperBound : lowerBound)(segments, column, index2);
|
|
4495
|
+
} else if (bias === LEAST_UPPER_BOUND) index2++;
|
|
4496
|
+
if (index2 === -1 || index2 === segments.length) return -1;
|
|
4497
|
+
return index2;
|
|
4216
4498
|
}
|
|
4217
4499
|
var CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
4218
4500
|
var SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
@@ -4254,7 +4536,7 @@ function extractLocation(urlLike) {
|
|
|
4254
4536
|
const urlObj = new URL(url);
|
|
4255
4537
|
urlObj.searchParams.delete("import");
|
|
4256
4538
|
urlObj.searchParams.delete("browserv");
|
|
4257
|
-
url = urlObj.pathname + urlObj.hash + urlObj.search;
|
|
4539
|
+
url = tryDecode(urlObj.pathname, decodeURI) + urlObj.hash + urlObj.search;
|
|
4258
4540
|
}
|
|
4259
4541
|
if (url.startsWith("/@fs/")) {
|
|
4260
4542
|
const isWindows2 = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
@@ -4267,6 +4549,13 @@ function extractLocation(urlLike) {
|
|
|
4267
4549
|
parts[3] || void 0
|
|
4268
4550
|
];
|
|
4269
4551
|
}
|
|
4552
|
+
function tryDecode(value, decode2) {
|
|
4553
|
+
try {
|
|
4554
|
+
return decode2(value);
|
|
4555
|
+
} catch {
|
|
4556
|
+
return value;
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4270
4559
|
function parseSingleFFOrSafariStack(raw) {
|
|
4271
4560
|
let line = raw.trim();
|
|
4272
4561
|
if (SAFARI_NATIVE_CODE_REGEXP.test(line)) return null;
|
|
@@ -4311,7 +4600,8 @@ function parseSingleV8Stack(raw) {
|
|
|
4311
4600
|
let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
|
|
4312
4601
|
if (!file || !lineNumber || !columnNumber) return null;
|
|
4313
4602
|
if (method.startsWith("async ")) method = method.slice(6);
|
|
4314
|
-
if (file.startsWith("file://"))
|
|
4603
|
+
if (file.startsWith("file://"))
|
|
4604
|
+
file = tryDecode(file.slice(7), decodeURIComponent);
|
|
4315
4605
|
file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
|
|
4316
4606
|
if (method) method = method.replace(/\(0\s?,\s?__vite_ssr_import_\d+__.(\w+)\)/g, "$1").replace(/__(vite_ssr_import|vi_import)_\d+__\./g, "").replace(/(Object\.)?__vite_ssr_export_default__\s?/g, "");
|
|
4317
4607
|
return {
|
|
@@ -4352,7 +4642,7 @@ function parseStacktrace(stack, options = {}) {
|
|
|
4352
4642
|
}).filter((s) => s != null);
|
|
4353
4643
|
}
|
|
4354
4644
|
function shouldFilter(ignoreStackEntries, file) {
|
|
4355
|
-
return ignoreStackEntries.some((
|
|
4645
|
+
return ignoreStackEntries.some((p2) => file.match(p2));
|
|
4356
4646
|
}
|
|
4357
4647
|
function parseFFOrSafariStackTrace(stack) {
|
|
4358
4648
|
return stack.split("\n").map((line) => parseSingleFFOrSafariStack(line)).filter(notNullish);
|
|
@@ -4360,18 +4650,18 @@ function parseFFOrSafariStackTrace(stack) {
|
|
|
4360
4650
|
function parseV8Stacktrace(stack) {
|
|
4361
4651
|
return stack.split("\n").map((line) => parseSingleV8Stack(line)).filter(notNullish);
|
|
4362
4652
|
}
|
|
4363
|
-
function parseErrorStacktrace(
|
|
4364
|
-
if (!
|
|
4365
|
-
if ("stacks" in
|
|
4366
|
-
const stackStr =
|
|
4653
|
+
function parseErrorStacktrace(e2, options = {}) {
|
|
4654
|
+
if (!e2 || isPrimitive(e2)) return [];
|
|
4655
|
+
if ("stacks" in e2 && e2.stacks) return e2.stacks;
|
|
4656
|
+
const stackStr = e2.stack || "";
|
|
4367
4657
|
let stackFrames = typeof stackStr === "string" ? parseStacktrace(stackStr, options) : [];
|
|
4368
4658
|
if (!stackFrames.length) {
|
|
4369
|
-
const e_ =
|
|
4659
|
+
const e_ = e2;
|
|
4370
4660
|
if (e_.fileName != null && e_.lineNumber != null && e_.columnNumber != null) stackFrames = parseStacktrace(`${e_.fileName}:${e_.lineNumber}:${e_.columnNumber}`, options);
|
|
4371
4661
|
if (e_.sourceURL != null && e_.line != null && e_._column != null) stackFrames = parseStacktrace(`${e_.sourceURL}:${e_.line}:${e_.column}`, options);
|
|
4372
4662
|
}
|
|
4373
|
-
if (options.frameFilter) stackFrames = stackFrames.filter((f) => options.frameFilter(
|
|
4374
|
-
|
|
4663
|
+
if (options.frameFilter) stackFrames = stackFrames.filter((f) => options.frameFilter(e2, f) !== false);
|
|
4664
|
+
e2.stacks = stackFrames;
|
|
4375
4665
|
return stackFrames;
|
|
4376
4666
|
}
|
|
4377
4667
|
var DecodedMap = class {
|
|
@@ -4407,7 +4697,7 @@ function getOriginalPosition(map2, needle) {
|
|
|
4407
4697
|
return result;
|
|
4408
4698
|
}
|
|
4409
4699
|
|
|
4410
|
-
// node_modules/vitest/dist/task-utils.js
|
|
4700
|
+
// ../../node_modules/vitest/dist/task-utils.js
|
|
4411
4701
|
// @__NO_SIDE_EFFECTS__
|
|
4412
4702
|
function getNames(task) {
|
|
4413
4703
|
const names = [task.name];
|
|
@@ -4424,7 +4714,7 @@ function createTaskName(names, separator = " > ") {
|
|
|
4424
4714
|
return names.filter((name) => name !== void 0).join(separator);
|
|
4425
4715
|
}
|
|
4426
4716
|
|
|
4427
|
-
// node_modules/vitest/dist/chunks/run.
|
|
4717
|
+
// ../../node_modules/vitest/dist/chunks/run.BPv-BBRv.js
|
|
4428
4718
|
var DIFF_DELETE = -1;
|
|
4429
4719
|
var DIFF_INSERT = 1;
|
|
4430
4720
|
var DIFF_EQUAL = 0;
|
|
@@ -4741,22 +5031,24 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
4741
5031
|
while (i3 !== iLength) {
|
|
4742
5032
|
const iStart = i3;
|
|
4743
5033
|
while (i3 !== iLength && diffs[i3][0] === DIFF_EQUAL) i3 += 1;
|
|
4744
|
-
if (iStart !== i3)
|
|
4745
|
-
if (
|
|
4746
|
-
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
|
|
4754
|
-
|
|
4755
|
-
|
|
4756
|
-
|
|
4757
|
-
|
|
4758
|
-
|
|
4759
|
-
|
|
5034
|
+
if (iStart !== i3) {
|
|
5035
|
+
if (iStart === 0) {
|
|
5036
|
+
if (i3 > nContextLines) {
|
|
5037
|
+
jLength -= i3 - nContextLines;
|
|
5038
|
+
hasExcessAtStartOrEnd = true;
|
|
5039
|
+
}
|
|
5040
|
+
} else if (i3 === iLength) {
|
|
5041
|
+
const n2 = i3 - iStart;
|
|
5042
|
+
if (n2 > nContextLines) {
|
|
5043
|
+
jLength -= n2 - nContextLines;
|
|
5044
|
+
hasExcessAtStartOrEnd = true;
|
|
5045
|
+
}
|
|
5046
|
+
} else {
|
|
5047
|
+
const n2 = i3 - iStart;
|
|
5048
|
+
if (n2 > nContextLines2) {
|
|
5049
|
+
jLength -= n2 - nContextLines2;
|
|
5050
|
+
nExcessesBetweenChanges += 1;
|
|
5051
|
+
}
|
|
4760
5052
|
}
|
|
4761
5053
|
}
|
|
4762
5054
|
while (i3 !== iLength && diffs[i3][0] !== DIFF_EQUAL) i3 += 1;
|
|
@@ -4792,33 +5084,35 @@ function joinAlignedDiffsNoExpand(diffs, options) {
|
|
|
4792
5084
|
while (i3 !== iLength) {
|
|
4793
5085
|
let iStart = i3;
|
|
4794
5086
|
while (i3 !== iLength && diffs[i3][0] === DIFF_EQUAL) i3 += 1;
|
|
4795
|
-
if (iStart !== i3)
|
|
4796
|
-
if (
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
|
|
4801
|
-
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
} else {
|
|
4808
|
-
const nCommon = i3 - iStart;
|
|
4809
|
-
if (nCommon > nContextLines2) {
|
|
4810
|
-
const iEnd = iStart + nContextLines;
|
|
5087
|
+
if (iStart !== i3) {
|
|
5088
|
+
if (iStart === 0) {
|
|
5089
|
+
if (i3 > nContextLines) {
|
|
5090
|
+
iStart = i3 - nContextLines;
|
|
5091
|
+
aStart = iStart;
|
|
5092
|
+
bStart = iStart;
|
|
5093
|
+
aEnd = aStart;
|
|
5094
|
+
bEnd = bStart;
|
|
5095
|
+
}
|
|
5096
|
+
for (let iCommon = iStart; iCommon !== i3; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
5097
|
+
} else if (i3 === iLength) {
|
|
5098
|
+
const iEnd = i3 - iStart > nContextLines ? iStart + nContextLines : i3;
|
|
4811
5099
|
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
4812
|
-
|
|
4813
|
-
|
|
4814
|
-
|
|
4815
|
-
|
|
4816
|
-
|
|
4817
|
-
|
|
4818
|
-
|
|
4819
|
-
|
|
4820
|
-
|
|
4821
|
-
|
|
5100
|
+
} else {
|
|
5101
|
+
const nCommon = i3 - iStart;
|
|
5102
|
+
if (nCommon > nContextLines2) {
|
|
5103
|
+
const iEnd = iStart + nContextLines;
|
|
5104
|
+
for (let iCommon = iStart; iCommon !== iEnd; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
5105
|
+
lines[jPatchMark] = createPatchMark(aStart, aEnd, bStart, bEnd, options);
|
|
5106
|
+
jPatchMark = lines.length;
|
|
5107
|
+
lines.push("");
|
|
5108
|
+
const nOmit = nCommon - nContextLines2;
|
|
5109
|
+
aStart = aEnd + nOmit;
|
|
5110
|
+
bStart = bEnd + nOmit;
|
|
5111
|
+
aEnd = aStart;
|
|
5112
|
+
bEnd = bStart;
|
|
5113
|
+
for (let iCommon = i3 - nContextLines; iCommon !== i3; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
5114
|
+
} else for (let iCommon = iStart; iCommon !== i3; iCommon += 1) pushCommonLine(diffs[iCommon][1]);
|
|
5115
|
+
}
|
|
4822
5116
|
}
|
|
4823
5117
|
while (i3 !== iLength && diffs[i3][0] === DIFF_DELETE) {
|
|
4824
5118
|
pushDeleteLine(diffs[i3][1]);
|
|
@@ -4852,14 +5146,14 @@ var DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0;
|
|
|
4852
5146
|
function getDefaultOptions() {
|
|
4853
5147
|
return {
|
|
4854
5148
|
aAnnotation: "Expected",
|
|
4855
|
-
aColor:
|
|
5149
|
+
aColor: $.green,
|
|
4856
5150
|
aIndicator: "-",
|
|
4857
5151
|
bAnnotation: "Received",
|
|
4858
|
-
bColor:
|
|
5152
|
+
bColor: $.red,
|
|
4859
5153
|
bIndicator: "+",
|
|
4860
|
-
changeColor:
|
|
5154
|
+
changeColor: $.inverse,
|
|
4861
5155
|
changeLineTrailingSpaceColor: noColor,
|
|
4862
|
-
commonColor:
|
|
5156
|
+
commonColor: $.dim,
|
|
4863
5157
|
commonIndicator: " ",
|
|
4864
5158
|
commonLineTrailingSpaceColor: noColor,
|
|
4865
5159
|
compareKeys: void 0,
|
|
@@ -4868,7 +5162,7 @@ function getDefaultOptions() {
|
|
|
4868
5162
|
expand: false,
|
|
4869
5163
|
includeChangeCounts: false,
|
|
4870
5164
|
omitAnnotationLines: false,
|
|
4871
|
-
patchColor:
|
|
5165
|
+
patchColor: $.yellow,
|
|
4872
5166
|
printBasicPrototype: false,
|
|
4873
5167
|
truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
|
|
4874
5168
|
truncateAnnotation: "... Diff result is truncated",
|
|
@@ -4893,19 +5187,19 @@ function isEmptyString(lines) {
|
|
|
4893
5187
|
return lines.length === 1 && lines[0].length === 0;
|
|
4894
5188
|
}
|
|
4895
5189
|
function countChanges(diffs) {
|
|
4896
|
-
let
|
|
5190
|
+
let a = 0;
|
|
4897
5191
|
let b2 = 0;
|
|
4898
5192
|
diffs.forEach((diff2) => {
|
|
4899
5193
|
switch (diff2[0]) {
|
|
4900
5194
|
case DIFF_DELETE:
|
|
4901
|
-
|
|
5195
|
+
a += 1;
|
|
4902
5196
|
break;
|
|
4903
5197
|
case DIFF_INSERT:
|
|
4904
5198
|
b2 += 1;
|
|
4905
5199
|
}
|
|
4906
5200
|
});
|
|
4907
5201
|
return {
|
|
4908
|
-
a
|
|
5202
|
+
a,
|
|
4909
5203
|
b: b2
|
|
4910
5204
|
};
|
|
4911
5205
|
}
|
|
@@ -4925,9 +5219,9 @@ function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor,
|
|
|
4925
5219
|
aRest = `${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`;
|
|
4926
5220
|
bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;
|
|
4927
5221
|
}
|
|
4928
|
-
const
|
|
5222
|
+
const a = `${aIndicator} ${aAnnotation}${aRest}`;
|
|
4929
5223
|
const b2 = `${bIndicator} ${bAnnotation}${bRest}`;
|
|
4930
|
-
return `${aColor(
|
|
5224
|
+
return `${aColor(a)}
|
|
4931
5225
|
${bColor(b2)}
|
|
4932
5226
|
|
|
4933
5227
|
`;
|
|
@@ -5016,37 +5310,37 @@ function getType3(value) {
|
|
|
5016
5310
|
function getNewLineSymbol(string2) {
|
|
5017
5311
|
return string2.includes("\r\n") ? "\r\n" : "\n";
|
|
5018
5312
|
}
|
|
5019
|
-
function diffStrings(
|
|
5313
|
+
function diffStrings(a, b2, options) {
|
|
5020
5314
|
const truncate2 = options?.truncateThreshold ?? false;
|
|
5021
5315
|
const truncateThreshold = Math.max(Math.floor(options?.truncateThreshold ?? 0), 0);
|
|
5022
|
-
let aLength =
|
|
5316
|
+
let aLength = a.length;
|
|
5023
5317
|
let bLength = b2.length;
|
|
5024
5318
|
if (truncate2) {
|
|
5025
|
-
const aMultipleLines =
|
|
5319
|
+
const aMultipleLines = a.includes("\n");
|
|
5026
5320
|
const bMultipleLines = b2.includes("\n");
|
|
5027
|
-
const aNewLineSymbol = getNewLineSymbol(
|
|
5321
|
+
const aNewLineSymbol = getNewLineSymbol(a);
|
|
5028
5322
|
const bNewLineSymbol = getNewLineSymbol(b2);
|
|
5029
|
-
const
|
|
5030
|
-
` :
|
|
5323
|
+
const _a = aMultipleLines ? `${a.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}
|
|
5324
|
+
` : a;
|
|
5031
5325
|
const _b = bMultipleLines ? `${b2.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}
|
|
5032
5326
|
` : b2;
|
|
5033
|
-
aLength =
|
|
5327
|
+
aLength = _a.length;
|
|
5034
5328
|
bLength = _b.length;
|
|
5035
5329
|
}
|
|
5036
|
-
const truncated = aLength !==
|
|
5037
|
-
const isCommon = (aIndex2, bIndex2) =>
|
|
5330
|
+
const truncated = aLength !== a.length || bLength !== b2.length;
|
|
5331
|
+
const isCommon = (aIndex2, bIndex2) => a[aIndex2] === b2[bIndex2];
|
|
5038
5332
|
let aIndex = 0;
|
|
5039
5333
|
let bIndex = 0;
|
|
5040
5334
|
const diffs = [];
|
|
5041
5335
|
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
|
5042
|
-
if (aIndex !== aCommon) diffs.push(new Diff(DIFF_DELETE,
|
|
5336
|
+
if (aIndex !== aCommon) diffs.push(new Diff(DIFF_DELETE, a.slice(aIndex, aCommon)));
|
|
5043
5337
|
if (bIndex !== bCommon) diffs.push(new Diff(DIFF_INSERT, b2.slice(bIndex, bCommon)));
|
|
5044
5338
|
aIndex = aCommon + nCommon;
|
|
5045
5339
|
bIndex = bCommon + nCommon;
|
|
5046
5340
|
diffs.push(new Diff(DIFF_EQUAL, b2.slice(bCommon, bIndex)));
|
|
5047
5341
|
};
|
|
5048
5342
|
diffSequences(aLength, bLength, isCommon, foundSubsequence);
|
|
5049
|
-
if (aIndex !== aLength) diffs.push(new Diff(DIFF_DELETE,
|
|
5343
|
+
if (aIndex !== aLength) diffs.push(new Diff(DIFF_DELETE, a.slice(aIndex)));
|
|
5050
5344
|
if (bIndex !== bLength) diffs.push(new Diff(DIFF_INSERT, b2.slice(bIndex)));
|
|
5051
5345
|
return [diffs, truncated];
|
|
5052
5346
|
}
|
|
@@ -5178,11 +5472,11 @@ function hasCommonDiff(diffs, isMultiline) {
|
|
|
5178
5472
|
}
|
|
5179
5473
|
return diffs.some((diff2) => diff2[0] === DIFF_EQUAL);
|
|
5180
5474
|
}
|
|
5181
|
-
function diffStringsUnified(
|
|
5182
|
-
if (
|
|
5183
|
-
const isMultiline =
|
|
5184
|
-
const [diffs, truncated] = diffStringsRaw(isMultiline ? `${
|
|
5185
|
-
` :
|
|
5475
|
+
function diffStringsUnified(a, b2, options) {
|
|
5476
|
+
if (a !== b2 && a.length !== 0 && b2.length !== 0) {
|
|
5477
|
+
const isMultiline = a.includes("\n") || b2.includes("\n");
|
|
5478
|
+
const [diffs, truncated] = diffStringsRaw(isMultiline ? `${a}
|
|
5479
|
+
` : a, isMultiline ? `${b2}
|
|
5186
5480
|
` : b2, true, options);
|
|
5187
5481
|
if (hasCommonDiff(diffs, isMultiline)) {
|
|
5188
5482
|
const optionsNormalized = normalizeDiffOptions(options);
|
|
@@ -5190,10 +5484,10 @@ function diffStringsUnified(a2, b2, options) {
|
|
|
5190
5484
|
return printDiffLines(lines, truncated, optionsNormalized);
|
|
5191
5485
|
}
|
|
5192
5486
|
}
|
|
5193
|
-
return diffLinesUnified(
|
|
5487
|
+
return diffLinesUnified(a.split("\n"), b2.split("\n"), options);
|
|
5194
5488
|
}
|
|
5195
|
-
function diffStringsRaw(
|
|
5196
|
-
const [diffs, truncated] = diffStrings(
|
|
5489
|
+
function diffStringsRaw(a, b2, cleanup, options) {
|
|
5490
|
+
const [diffs, truncated] = diffStrings(a, b2, options);
|
|
5197
5491
|
diff_cleanupSemantic(diffs);
|
|
5198
5492
|
return [diffs, truncated];
|
|
5199
5493
|
}
|
|
@@ -5220,18 +5514,18 @@ var FALLBACK_FORMAT_OPTIONS = {
|
|
|
5220
5514
|
maxDepth: 8,
|
|
5221
5515
|
plugins: PLUGINS2
|
|
5222
5516
|
};
|
|
5223
|
-
var DEFAULT_MEMORIZE = (
|
|
5224
|
-
function diff(
|
|
5225
|
-
if (Object.is(
|
|
5226
|
-
const aType = getType3(
|
|
5517
|
+
var DEFAULT_MEMORIZE = (_2, v) => v;
|
|
5518
|
+
function diff(a, b2, options, memorize = DEFAULT_MEMORIZE) {
|
|
5519
|
+
if (Object.is(a, b2)) return "";
|
|
5520
|
+
const aType = getType3(a);
|
|
5227
5521
|
let expectedType = aType;
|
|
5228
5522
|
let omitDifference = false;
|
|
5229
|
-
if (aType === "object" && typeof
|
|
5230
|
-
if (
|
|
5523
|
+
if (aType === "object" && typeof a.asymmetricMatch === "function") {
|
|
5524
|
+
if (a.$$typeof !== Symbol.for("jest.asymmetricMatcher"))
|
|
5231
5525
|
return;
|
|
5232
|
-
if (typeof
|
|
5526
|
+
if (typeof a.getExpectedType !== "function")
|
|
5233
5527
|
return;
|
|
5234
|
-
expectedType =
|
|
5528
|
+
expectedType = a.getExpectedType();
|
|
5235
5529
|
omitDifference = expectedType === "string";
|
|
5236
5530
|
}
|
|
5237
5531
|
if (expectedType !== getType3(b2)) {
|
|
@@ -5241,7 +5535,7 @@ function diff(a2, b2, options, memorize = DEFAULT_MEMORIZE) {
|
|
|
5241
5535
|
var truncate2 = truncate3;
|
|
5242
5536
|
const { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator } = normalizeDiffOptions(options);
|
|
5243
5537
|
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
5244
|
-
let aDisplay = format(
|
|
5538
|
+
let aDisplay = format(a, formatOptions);
|
|
5245
5539
|
let bDisplay = format(b2, formatOptions);
|
|
5246
5540
|
const MAX_LENGTH = 1e5;
|
|
5247
5541
|
aDisplay = memorize("expected", truncate3(aDisplay));
|
|
@@ -5255,16 +5549,16 @@ ${bDisplay}`}`;
|
|
|
5255
5549
|
if (omitDifference) return;
|
|
5256
5550
|
switch (aType) {
|
|
5257
5551
|
case "string":
|
|
5258
|
-
return diffLinesUnified(
|
|
5552
|
+
return diffLinesUnified(a.split("\n"), b2.split("\n"), options);
|
|
5259
5553
|
case "boolean":
|
|
5260
5554
|
case "number":
|
|
5261
|
-
return comparePrimitive(
|
|
5555
|
+
return comparePrimitive(a, b2, options, memorize);
|
|
5262
5556
|
case "map":
|
|
5263
|
-
return compareObjects(sortMap(
|
|
5557
|
+
return compareObjects(sortMap(a), sortMap(b2), options, memorize);
|
|
5264
5558
|
case "set":
|
|
5265
|
-
return compareObjects(sortSet(
|
|
5559
|
+
return compareObjects(sortSet(a), sortSet(b2), options, memorize);
|
|
5266
5560
|
default:
|
|
5267
|
-
return compareObjects(
|
|
5561
|
+
return compareObjects(a, b2, options, memorize);
|
|
5268
5562
|
}
|
|
5269
5563
|
}
|
|
5270
5564
|
function createMemorize(memory) {
|
|
@@ -5273,8 +5567,8 @@ function createMemorize(memory) {
|
|
|
5273
5567
|
return stringifiedValue;
|
|
5274
5568
|
};
|
|
5275
5569
|
}
|
|
5276
|
-
function comparePrimitive(
|
|
5277
|
-
const aFormat = memorize("expected", format(
|
|
5570
|
+
function comparePrimitive(a, b2, options, memorize = DEFAULT_MEMORIZE) {
|
|
5571
|
+
const aFormat = memorize("expected", format(a, FORMAT_OPTIONS));
|
|
5278
5572
|
const bFormat = memorize("actual", format(b2, FORMAT_OPTIONS));
|
|
5279
5573
|
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split("\n"), bFormat.split("\n"), options);
|
|
5280
5574
|
}
|
|
@@ -5284,17 +5578,17 @@ function sortMap(map2) {
|
|
|
5284
5578
|
function sortSet(set3) {
|
|
5285
5579
|
return new Set(Array.from(set3.values()).sort());
|
|
5286
5580
|
}
|
|
5287
|
-
function compareObjects(
|
|
5581
|
+
function compareObjects(a, b2, options, memorize = DEFAULT_MEMORIZE) {
|
|
5288
5582
|
let difference;
|
|
5289
5583
|
let hasThrown = false;
|
|
5290
5584
|
try {
|
|
5291
|
-
difference = getObjectsDifference(
|
|
5585
|
+
difference = getObjectsDifference(a, b2, getFormatOptions(FORMAT_OPTIONS, options), options, memorize);
|
|
5292
5586
|
} catch {
|
|
5293
5587
|
hasThrown = true;
|
|
5294
5588
|
}
|
|
5295
5589
|
const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
5296
5590
|
if (difference === void 0 || difference === noDiffMessage) {
|
|
5297
|
-
difference = getObjectsDifference(
|
|
5591
|
+
difference = getObjectsDifference(a, b2, getFormatOptions(FALLBACK_FORMAT_OPTIONS, options), options, memorize);
|
|
5298
5592
|
if (difference !== noDiffMessage && !hasThrown) difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}
|
|
5299
5593
|
|
|
5300
5594
|
${difference}`;
|
|
@@ -5313,16 +5607,16 @@ function getFormatOptions(formatOptions, options) {
|
|
|
5313
5607
|
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
5314
5608
|
};
|
|
5315
5609
|
}
|
|
5316
|
-
function getObjectsDifference(
|
|
5610
|
+
function getObjectsDifference(a, b2, formatOptions, options, memorize = DEFAULT_MEMORIZE) {
|
|
5317
5611
|
const formatOptionsZeroIndent = {
|
|
5318
5612
|
...formatOptions,
|
|
5319
5613
|
indent: 0
|
|
5320
5614
|
};
|
|
5321
|
-
const aCompare = format(
|
|
5615
|
+
const aCompare = format(a, formatOptionsZeroIndent);
|
|
5322
5616
|
const bCompare = format(b2, formatOptionsZeroIndent);
|
|
5323
5617
|
if (aCompare === bCompare) return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
5324
5618
|
else {
|
|
5325
|
-
const aDisplay = memorize("expected", format(
|
|
5619
|
+
const aDisplay = memorize("expected", format(a, formatOptions));
|
|
5326
5620
|
const bDisplay = memorize("actual", format(b2, formatOptions));
|
|
5327
5621
|
return diffLinesUnified2(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
|
|
5328
5622
|
}
|
|
@@ -5405,13 +5699,13 @@ function replaceTrailingSpaces(text) {
|
|
|
5405
5699
|
return text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
|
5406
5700
|
}
|
|
5407
5701
|
function printReceived(object2) {
|
|
5408
|
-
return
|
|
5702
|
+
return $.red(replaceTrailingSpaces(stringify(object2)));
|
|
5409
5703
|
}
|
|
5410
5704
|
function printExpected(value) {
|
|
5411
|
-
return
|
|
5705
|
+
return $.green(replaceTrailingSpaces(stringify(value)));
|
|
5412
5706
|
}
|
|
5413
5707
|
function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff2) {
|
|
5414
|
-
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ?
|
|
5708
|
+
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ? $.inverse(diff2[1]) : diff2[1] : ""), "");
|
|
5415
5709
|
}
|
|
5416
5710
|
function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
5417
5711
|
if (!_err || typeof _err !== "object") return { message: String(_err) };
|
|
@@ -5434,8 +5728,8 @@ function processError(_err, diffOptions, seen = /* @__PURE__ */ new WeakSet()) {
|
|
|
5434
5728
|
}
|
|
5435
5729
|
try {
|
|
5436
5730
|
return serializeValue(err);
|
|
5437
|
-
} catch (
|
|
5438
|
-
return serializeValue(/* @__PURE__ */ new Error(`Failed to fully serialize error: ${
|
|
5731
|
+
} catch (e2) {
|
|
5732
|
+
return serializeValue(/* @__PURE__ */ new Error(`Failed to fully serialize error: ${e2?.message}
|
|
5439
5733
|
Inner error message: ${err?.message}`));
|
|
5440
5734
|
}
|
|
5441
5735
|
}
|
|
@@ -5685,8 +5979,12 @@ function withFixtures(fn2, options) {
|
|
|
5685
5979
|
for (const fixture of pendingFixtures) if (fixture.scope === "test") {
|
|
5686
5980
|
if (cachedFixtures.has(fixture)) continue;
|
|
5687
5981
|
cachedFixtures.add(fixture);
|
|
5688
|
-
|
|
5689
|
-
|
|
5982
|
+
try {
|
|
5983
|
+
context[fixture.name] = await resolveTestFixtureValue(fixture, context, cleanupFnArray);
|
|
5984
|
+
} catch (error) {
|
|
5985
|
+
cachedFixtures.delete(fixture);
|
|
5986
|
+
throw error;
|
|
5987
|
+
}
|
|
5690
5988
|
cleanupFnArray.push(() => {
|
|
5691
5989
|
cachedFixtures.delete(fixture);
|
|
5692
5990
|
});
|
|
@@ -5727,8 +6025,9 @@ async function resolveScopeFixtureValue(fixtures, suite2, fixture) {
|
|
|
5727
6025
|
...fileContext
|
|
5728
6026
|
} : fixtureContext, cleanupFnFileArray).then((value) => {
|
|
5729
6027
|
fixtureContext[fixture.name] = value;
|
|
5730
|
-
scopedFixturePromiseCache.delete(fixture);
|
|
5731
6028
|
return value;
|
|
6029
|
+
}).finally(() => {
|
|
6030
|
+
scopedFixturePromiseCache.delete(fixture);
|
|
5732
6031
|
});
|
|
5733
6032
|
scopedFixturePromiseCache.set(fixture, promise);
|
|
5734
6033
|
return promise;
|
|
@@ -5752,12 +6051,12 @@ async function resolveFixtureFunction(fixtureFn, fixtureName, context, cleanupFn
|
|
|
5752
6051
|
if (stackTraceError?.stack) error.stack = error.message + stackTraceError.stack.replace(stackTraceError.message, "");
|
|
5753
6052
|
useFnArgPromise.reject(error);
|
|
5754
6053
|
}
|
|
5755
|
-
}).catch((
|
|
6054
|
+
}).catch((e2) => {
|
|
5756
6055
|
if (!isUseFnArgResolved) {
|
|
5757
|
-
useFnArgPromise.reject(
|
|
6056
|
+
useFnArgPromise.reject(e2);
|
|
5758
6057
|
return;
|
|
5759
6058
|
}
|
|
5760
|
-
throw
|
|
6059
|
+
throw e2;
|
|
5761
6060
|
});
|
|
5762
6061
|
return useFnArgPromise;
|
|
5763
6062
|
}
|
|
@@ -5768,10 +6067,12 @@ function resolveDeps(usedFixtures, registrations, depSet = /* @__PURE__ */ new S
|
|
|
5768
6067
|
pendingFixtures.push(fixture);
|
|
5769
6068
|
return;
|
|
5770
6069
|
}
|
|
5771
|
-
if (depSet.has(fixture))
|
|
5772
|
-
|
|
6070
|
+
if (depSet.has(fixture)) {
|
|
6071
|
+
if (fixture.parent) fixture = fixture.parent;
|
|
6072
|
+
else throw new Error(`Circular fixture dependency detected: ${fixture.name} <- ${[...depSet].reverse().map((d2) => d2.name).join(" <- ")}`);
|
|
6073
|
+
}
|
|
5773
6074
|
depSet.add(fixture);
|
|
5774
|
-
resolveDeps(Array.from(fixture.deps, (
|
|
6075
|
+
resolveDeps(Array.from(fixture.deps, (n2) => n2 === fixture.name ? fixture.parent : registrations.get(n2)).filter((n2) => !!n2), registrations, depSet, pendingFixtures);
|
|
5775
6076
|
pendingFixtures.push(fixture);
|
|
5776
6077
|
depSet.clear();
|
|
5777
6078
|
});
|
|
@@ -5861,6 +6162,10 @@ function createChainable(keys2, fn2, context) {
|
|
|
5861
6162
|
Object.defineProperty(chain2, kChainableContext, {
|
|
5862
6163
|
value: {
|
|
5863
6164
|
withContext: () => chain2.bind(context2),
|
|
6165
|
+
extendContext: (ctx) => create({
|
|
6166
|
+
...context2,
|
|
6167
|
+
...ctx
|
|
6168
|
+
}),
|
|
5864
6169
|
getFixtures: () => context2.fixtures,
|
|
5865
6170
|
setContext: (key, value) => {
|
|
5866
6171
|
context2[key] = value;
|
|
@@ -6006,7 +6311,7 @@ function validateTags(config2, tags) {
|
|
|
6006
6311
|
function createNoTagsError(availableTags, tag, prefix = "tag") {
|
|
6007
6312
|
if (!availableTags.length) throw new Error(`The Vitest config doesn't define any "tags", cannot apply "${tag}" ${prefix} for this test. See: https://vitest.dev/guide/test-tags`);
|
|
6008
6313
|
throw new Error(`The ${prefix} "${tag}" is not defined in the configuration. Available tags are:
|
|
6009
|
-
${availableTags.map((
|
|
6314
|
+
${availableTags.map((t3) => `- ${t3.name}${t3.description ? `: ${t3.description}` : ""}`).join("\n")}`);
|
|
6010
6315
|
}
|
|
6011
6316
|
var suite = createSuite();
|
|
6012
6317
|
var test2 = createTest(function(name, optionsOrFn, optionsOrTest) {
|
|
@@ -6044,6 +6349,10 @@ function createSuiteHooks() {
|
|
|
6044
6349
|
};
|
|
6045
6350
|
}
|
|
6046
6351
|
var POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
|
|
6352
|
+
function assignDefined(target, source) {
|
|
6353
|
+
for (const key in source) if (source[key] !== void 0) target[key] = source[key];
|
|
6354
|
+
return target;
|
|
6355
|
+
}
|
|
6047
6356
|
function parseArguments(optionsOrFn, timeoutOrTest) {
|
|
6048
6357
|
if (timeoutOrTest != null && typeof timeoutOrTest === "object") throw new TypeError(`Signature "test(name, fn, { ... })" was deprecated in Vitest 3 and removed in Vitest 4. Please, provide options as a second argument instead.`);
|
|
6049
6358
|
let options = {};
|
|
@@ -6069,21 +6378,21 @@ function createSuiteCollector(name, factory = () => {
|
|
|
6069
6378
|
const parentTags = (currentSuite ?? collectorContext.currentSuite?.file)?.tags || [];
|
|
6070
6379
|
const testTags = unique([...parentTags, ...toArray(options.tags)]);
|
|
6071
6380
|
const tagsOptions = testTags.map((tag) => {
|
|
6072
|
-
const tagDefinition = runner.config.tags?.find((
|
|
6381
|
+
const tagDefinition = runner.config.tags?.find((t3) => t3.name === tag);
|
|
6073
6382
|
if (!tagDefinition && runner.config.strictTags) throw createNoTagsError(runner.config.tags, tag);
|
|
6074
6383
|
return tagDefinition;
|
|
6075
|
-
}).filter((
|
|
6384
|
+
}).filter((r) => r != null).sort((tag1, tag2) => (tag2.priority ?? POSITIVE_INFINITY) - (tag1.priority ?? POSITIVE_INFINITY)).reduce((acc, tag) => {
|
|
6076
6385
|
const { name: name3, description, priority, meta, ...options2 } = tag;
|
|
6077
|
-
|
|
6386
|
+
assignDefined(acc, options2);
|
|
6078
6387
|
if (meta) acc.meta = Object.assign(acc.meta ?? /* @__PURE__ */ Object.create(null), meta);
|
|
6079
6388
|
return acc;
|
|
6080
6389
|
}, {});
|
|
6081
6390
|
const testOwnMeta = options.meta;
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
...
|
|
6085
|
-
...
|
|
6086
|
-
};
|
|
6391
|
+
const parentOptions = collectorContext.currentSuite?.options;
|
|
6392
|
+
options = assignDefined({
|
|
6393
|
+
...parentOptions,
|
|
6394
|
+
...tagsOptions
|
|
6395
|
+
}, options);
|
|
6087
6396
|
const timeout = options.timeout ?? runner.config.testTimeout;
|
|
6088
6397
|
const parentMeta = currentSuite?.meta;
|
|
6089
6398
|
const tagMeta = tagsOptions.meta;
|
|
@@ -6126,7 +6435,7 @@ function createSuiteCollector(name, factory = () => {
|
|
|
6126
6435
|
Error.stackTraceLimit = 10;
|
|
6127
6436
|
const stackTraceError = /* @__PURE__ */ new Error("STACK_TRACE_ERROR");
|
|
6128
6437
|
Error.stackTraceLimit = limit;
|
|
6129
|
-
if (handler) setFn(task2, withTimeout(withCancel(withAwaitAsyncAssertions(withFixtures(handler, { context }), task2), task2.context.signal), timeout, false, stackTraceError, (
|
|
6438
|
+
if (handler) setFn(task2, withTimeout(withCancel(withAwaitAsyncAssertions(withFixtures(handler, { context }), task2), task2.context.signal), timeout, false, stackTraceError, (_2, error) => abortIfTimeout([context], error)));
|
|
6130
6439
|
if (runner.config.includeTaskLocation) {
|
|
6131
6440
|
const stack = findTestFileStackTrace(currentTestFilepath, stackTraceError);
|
|
6132
6441
|
if (stack) task2.location = {
|
|
@@ -6142,8 +6451,7 @@ function createSuiteCollector(name, factory = () => {
|
|
|
6142
6451
|
const concurrent = this.concurrent ?? options?.concurrent;
|
|
6143
6452
|
if (concurrent != null) options.concurrent = concurrent;
|
|
6144
6453
|
const test6 = task(formatName(name2), {
|
|
6145
|
-
...this,
|
|
6146
|
-
...options,
|
|
6454
|
+
...assignDefined({ ...this }, options),
|
|
6147
6455
|
handler
|
|
6148
6456
|
});
|
|
6149
6457
|
test6.type = "test";
|
|
@@ -6228,7 +6536,7 @@ function withAwaitAsyncAssertions(fn2, task) {
|
|
|
6228
6536
|
return (async (...args) => {
|
|
6229
6537
|
const fnResult = await fn2(...args);
|
|
6230
6538
|
if (task.promises) {
|
|
6231
|
-
const errors = (await Promise.allSettled(task.promises)).map((
|
|
6539
|
+
const errors = (await Promise.allSettled(task.promises)).map((r) => r.status === "rejected" ? r.reason : void 0).filter(Boolean);
|
|
6232
6540
|
if (errors.length) throw errors;
|
|
6233
6541
|
}
|
|
6234
6542
|
return fnResult;
|
|
@@ -6240,10 +6548,7 @@ function createSuite() {
|
|
|
6240
6548
|
const currentSuite = collectorContext.currentSuite || defaultSuite;
|
|
6241
6549
|
let { options, handler: factory } = parseArguments(factoryOrOptions, optionsOrFactory);
|
|
6242
6550
|
const { meta: parentMeta, ...parentOptions } = currentSuite?.options || {};
|
|
6243
|
-
options = {
|
|
6244
|
-
...parentOptions,
|
|
6245
|
-
...options
|
|
6246
|
-
};
|
|
6551
|
+
options = assignDefined({ ...parentOptions }, options);
|
|
6247
6552
|
const shuffle = this.shuffle ?? options.shuffle ?? currentSuite?.options?.shuffle ?? runner?.config.sequence.shuffle;
|
|
6248
6553
|
if (shuffle != null) options.shuffle = shuffle;
|
|
6249
6554
|
let mode = this.only ?? options.only ? "only" : this.skip ?? options.skip ? "skip" : this.todo ?? options.todo ? "todo" : "run";
|
|
@@ -6265,9 +6570,10 @@ function createSuite() {
|
|
|
6265
6570
|
const fnFirst = typeof optionsOrFn === "function";
|
|
6266
6571
|
cases.forEach((i3, idx) => {
|
|
6267
6572
|
const items = Array.isArray(i3) ? i3 : [i3];
|
|
6268
|
-
if (fnFirst)
|
|
6269
|
-
|
|
6270
|
-
|
|
6573
|
+
if (fnFirst) {
|
|
6574
|
+
if (arrayOnlyCases) suite2(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
|
|
6575
|
+
else suite2(formatTitle(_name, items, idx), handler ? () => handler(i3) : void 0, options.timeout);
|
|
6576
|
+
} else if (arrayOnlyCases) suite2(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
|
|
6271
6577
|
else suite2(formatTitle(_name, items, idx), options, handler ? () => handler(i3) : void 0);
|
|
6272
6578
|
});
|
|
6273
6579
|
context.setContext("each", void 0);
|
|
@@ -6308,9 +6614,10 @@ function createTaskCollector(fn2) {
|
|
|
6308
6614
|
const fnFirst = typeof optionsOrFn === "function";
|
|
6309
6615
|
cases.forEach((i3, idx) => {
|
|
6310
6616
|
const items = Array.isArray(i3) ? i3 : [i3];
|
|
6311
|
-
if (fnFirst)
|
|
6312
|
-
|
|
6313
|
-
|
|
6617
|
+
if (fnFirst) {
|
|
6618
|
+
if (arrayOnlyCases) test5(formatTitle(_name, items, idx), handler ? () => handler(...items) : void 0, options.timeout);
|
|
6619
|
+
else test5(formatTitle(_name, items, idx), handler ? () => handler(i3) : void 0, options.timeout);
|
|
6620
|
+
} else if (arrayOnlyCases) test5(formatTitle(_name, items, idx), options, handler ? () => handler(...items) : void 0);
|
|
6314
6621
|
else test5(formatTitle(_name, items, idx), options, handler ? () => handler(i3) : void 0);
|
|
6315
6622
|
});
|
|
6316
6623
|
context.setContext("each", void 0);
|
|
@@ -6333,10 +6640,10 @@ function createTaskCollector(fn2) {
|
|
|
6333
6640
|
};
|
|
6334
6641
|
};
|
|
6335
6642
|
taskFn.skipIf = function(condition) {
|
|
6336
|
-
return
|
|
6643
|
+
return getChainableContext(this).extendContext({ skip: !!condition });
|
|
6337
6644
|
};
|
|
6338
6645
|
taskFn.runIf = function(condition) {
|
|
6339
|
-
return
|
|
6646
|
+
return getChainableContext(this).extendContext({ skip: !condition });
|
|
6340
6647
|
};
|
|
6341
6648
|
function parseBuilderFixtures(fixturesOrName, optionsOrFn, maybeFn) {
|
|
6342
6649
|
if (typeof fixturesOrName !== "string") return fixturesOrName;
|
|
@@ -6415,7 +6722,7 @@ function formatTitle(template, items, idx) {
|
|
|
6415
6722
|
if (template.includes("%#") || template.includes("%$"))
|
|
6416
6723
|
template = template.replace(/%%/g, "__vitest_escaped_%__").replace(/%#/g, `${idx}`).replace(/%\$/g, `${idx + 1}`).replace(/__vitest_escaped_%__/g, "%%");
|
|
6417
6724
|
const count = template.split("%").length - 1;
|
|
6418
|
-
if (template.includes("%f")) (template.match(/%f/g) || []).forEach((
|
|
6725
|
+
if (template.includes("%f")) (template.match(/%f/g) || []).forEach((_2, i4) => {
|
|
6419
6726
|
if (isNegativeNaN(items[i4]) || Object.is(items[i4], -0)) {
|
|
6420
6727
|
let occurrence = 0;
|
|
6421
6728
|
template = template.replace(/%f/g, (match) => {
|
|
@@ -6427,12 +6734,12 @@ function formatTitle(template, items, idx) {
|
|
|
6427
6734
|
const inspectOptions = { truncate: runner.config.taskTitleValueFormatTruncate };
|
|
6428
6735
|
const isObjectItem = isObject(items[0]);
|
|
6429
6736
|
function formatAttribute(s) {
|
|
6430
|
-
return s.replace(/\$([$\p{ID_Continue}.]+)/gu, (
|
|
6737
|
+
return s.replace(/\$([$\p{ID_Continue}.]+)/gu, (_2, key) => {
|
|
6431
6738
|
const isArrayKey = /^\d+$/.test(key);
|
|
6432
6739
|
if (!isObjectItem && !isArrayKey) return `$${key}`;
|
|
6433
6740
|
const arrayElement = isArrayKey ? objectAttr(items, key) : void 0;
|
|
6434
6741
|
const value = isObjectItem ? objectAttr(items[0], key, arrayElement) : arrayElement;
|
|
6435
|
-
if (typeof value === "string") return truncateString(value, inspectOptions.truncate);
|
|
6742
|
+
if (typeof value === "string") return inspectOptions.truncate ? truncateString(value, inspectOptions.truncate) : value;
|
|
6436
6743
|
return inspect(value, inspectOptions);
|
|
6437
6744
|
});
|
|
6438
6745
|
}
|
|
@@ -6500,27 +6807,27 @@ function encodeUint8Array(bytes) {
|
|
|
6500
6807
|
let base64 = "";
|
|
6501
6808
|
const len = bytes.byteLength;
|
|
6502
6809
|
for (let i3 = 0; i3 < len; i3 += 3) if (len === i3 + 1) {
|
|
6503
|
-
const
|
|
6810
|
+
const a = (bytes[i3] & 252) >> 2;
|
|
6504
6811
|
const b2 = (bytes[i3] & 3) << 4;
|
|
6505
|
-
base64 += table[
|
|
6812
|
+
base64 += table[a];
|
|
6506
6813
|
base64 += table[b2];
|
|
6507
6814
|
base64 += "==";
|
|
6508
6815
|
} else if (len === i3 + 2) {
|
|
6509
|
-
const
|
|
6816
|
+
const a = (bytes[i3] & 252) >> 2;
|
|
6510
6817
|
const b2 = (bytes[i3] & 3) << 4 | (bytes[i3 + 1] & 240) >> 4;
|
|
6511
|
-
const
|
|
6512
|
-
base64 += table[
|
|
6818
|
+
const c2 = (bytes[i3 + 1] & 15) << 2;
|
|
6819
|
+
base64 += table[a];
|
|
6513
6820
|
base64 += table[b2];
|
|
6514
|
-
base64 += table[
|
|
6821
|
+
base64 += table[c2];
|
|
6515
6822
|
base64 += "=";
|
|
6516
6823
|
} else {
|
|
6517
|
-
const
|
|
6824
|
+
const a = (bytes[i3] & 252) >> 2;
|
|
6518
6825
|
const b2 = (bytes[i3] & 3) << 4 | (bytes[i3 + 1] & 240) >> 4;
|
|
6519
|
-
const
|
|
6826
|
+
const c2 = (bytes[i3 + 1] & 15) << 2 | (bytes[i3 + 2] & 192) >> 6;
|
|
6520
6827
|
const d2 = bytes[i3 + 2] & 63;
|
|
6521
|
-
base64 += table[
|
|
6828
|
+
base64 += table[a];
|
|
6522
6829
|
base64 += table[b2];
|
|
6523
|
-
base64 += table[
|
|
6830
|
+
base64 += table[c2];
|
|
6524
6831
|
base64 += table[d2];
|
|
6525
6832
|
}
|
|
6526
6833
|
return base64;
|
|
@@ -6528,8 +6835,8 @@ function encodeUint8Array(bytes) {
|
|
|
6528
6835
|
function recordAsyncOperation(test5, promise) {
|
|
6529
6836
|
promise = promise.finally(() => {
|
|
6530
6837
|
if (!test5.promises) return;
|
|
6531
|
-
const
|
|
6532
|
-
if (
|
|
6838
|
+
const index2 = test5.promises.indexOf(promise);
|
|
6839
|
+
if (index2 !== -1) test5.promises.splice(index2, 1);
|
|
6533
6840
|
});
|
|
6534
6841
|
if (!test5.promises) test5.promises = [];
|
|
6535
6842
|
test5.promises.push(promise);
|
|
@@ -6615,7 +6922,7 @@ async function runWithSuite(suite2, fn2) {
|
|
|
6615
6922
|
}
|
|
6616
6923
|
function withTimeout(fn2, timeout, isHook = false, stackTraceError, onTimeout) {
|
|
6617
6924
|
if (timeout <= 0 || timeout === Number.POSITIVE_INFINITY) return fn2;
|
|
6618
|
-
return
|
|
6925
|
+
return function runWithTimeout(...args) {
|
|
6619
6926
|
const runner2 = getRunner();
|
|
6620
6927
|
const previousDeadline = runner2._deadline;
|
|
6621
6928
|
return new Promise((resolve_, reject_) => {
|
|
@@ -6661,10 +6968,10 @@ function withTimeout(fn2, timeout, isHook = false, stackTraceError, onTimeout) {
|
|
|
6661
6968
|
reject(error);
|
|
6662
6969
|
}
|
|
6663
6970
|
});
|
|
6664
|
-
}
|
|
6971
|
+
};
|
|
6665
6972
|
}
|
|
6666
6973
|
function withCancel(fn2, signal) {
|
|
6667
|
-
return
|
|
6974
|
+
return function runWithCancel(...args) {
|
|
6668
6975
|
return new Promise((resolve2, reject) => {
|
|
6669
6976
|
const onAbort = () => reject(signal.reason);
|
|
6670
6977
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
@@ -6687,7 +6994,7 @@ function withCancel(fn2, signal) {
|
|
|
6687
6994
|
reject(error);
|
|
6688
6995
|
}
|
|
6689
6996
|
});
|
|
6690
|
-
}
|
|
6997
|
+
};
|
|
6691
6998
|
}
|
|
6692
6999
|
var abortControllers = /* @__PURE__ */ new WeakMap();
|
|
6693
7000
|
function abortIfTimeout([context], error) {
|
|
@@ -6738,11 +7045,11 @@ function createTestContext(test5, runner2) {
|
|
|
6738
7045
|
});
|
|
6739
7046
|
context.onTestFailed = (handler, timeout) => {
|
|
6740
7047
|
test5.onFailed || (test5.onFailed = []);
|
|
6741
|
-
test5.onFailed.push(withTimeout(handler, timeout ?? runner2.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (
|
|
7048
|
+
test5.onFailed.push(withTimeout(handler, timeout ?? runner2.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_2, error) => abortController.abort(error)));
|
|
6742
7049
|
};
|
|
6743
7050
|
context.onTestFinished = (handler, timeout) => {
|
|
6744
7051
|
test5.onFinished || (test5.onFinished = []);
|
|
6745
|
-
test5.onFinished.push(withTimeout(handler, timeout ?? runner2.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (
|
|
7052
|
+
test5.onFinished.push(withTimeout(handler, timeout ?? runner2.config.hookTimeout, true, /* @__PURE__ */ new Error("STACK_TRACE_ERROR"), (_2, error) => abortController.abort(error)));
|
|
6746
7053
|
};
|
|
6747
7054
|
return runner2.extendTaskContext?.(context) || context;
|
|
6748
7055
|
}
|
|
@@ -6772,10 +7079,10 @@ function sendTasksUpdate(runner2) {
|
|
|
6772
7079
|
task[1]
|
|
6773
7080
|
];
|
|
6774
7081
|
});
|
|
6775
|
-
const
|
|
6776
|
-
if (
|
|
6777
|
-
pendingTasksUpdates.push(
|
|
6778
|
-
|
|
7082
|
+
const p2 = runner2.onTaskUpdate?.(taskPacks, eventsPacks);
|
|
7083
|
+
if (p2) {
|
|
7084
|
+
pendingTasksUpdates.push(p2);
|
|
7085
|
+
p2.then(() => pendingTasksUpdates.splice(pendingTasksUpdates.indexOf(p2), 1), () => {
|
|
6779
7086
|
});
|
|
6780
7087
|
}
|
|
6781
7088
|
eventsPacks.length = 0;
|
|
@@ -6802,7 +7109,7 @@ function throttle(fn2, ms) {
|
|
|
6802
7109
|
}
|
|
6803
7110
|
var sendTasksUpdateThrottled = throttle(sendTasksUpdate, 100);
|
|
6804
7111
|
|
|
6805
|
-
// node_modules/vitest/dist/chunks/utils.DYj33du9.js
|
|
7112
|
+
// ../../node_modules/vitest/dist/chunks/utils.DYj33du9.js
|
|
6806
7113
|
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
6807
7114
|
function getWorkerState() {
|
|
6808
7115
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -6828,19 +7135,41 @@ function resetModules(modules, resetMocks = false) {
|
|
|
6828
7135
|
});
|
|
6829
7136
|
}
|
|
6830
7137
|
|
|
6831
|
-
// node_modules/vitest/dist/chunks/spy.
|
|
7138
|
+
// ../../node_modules/vitest/dist/chunks/spy.DDMXghXv.js
|
|
6832
7139
|
function isMockFunction(fn2) {
|
|
6833
7140
|
return typeof fn2 === "function" && "_isMockFunction" in fn2 && fn2._isMockFunction === true;
|
|
6834
7141
|
}
|
|
6835
7142
|
var MOCK_RESTORE = /* @__PURE__ */ new Set();
|
|
6836
7143
|
var DIRTY_MOCK_STATES = /* @__PURE__ */ new Set();
|
|
6837
|
-
var
|
|
6838
|
-
var
|
|
7144
|
+
var DIRTY_MOCK_CONFIGS = /* @__PURE__ */ new Set();
|
|
7145
|
+
var addToSet = Set.prototype.add;
|
|
7146
|
+
var MOCK_REFS = /* @__PURE__ */ new WeakMap();
|
|
6839
7147
|
var MOCK_FINALIZER = new FinalizationRegistry((ref) => {
|
|
6840
|
-
|
|
7148
|
+
DIRTY_MOCK_STATES.delete(ref);
|
|
7149
|
+
DIRTY_MOCK_CONFIGS.delete(ref);
|
|
6841
7150
|
});
|
|
6842
7151
|
var MOCK_CONFIGS = /* @__PURE__ */ new WeakMap();
|
|
6843
7152
|
var MOCKS_BY_STATE = /* @__PURE__ */ new WeakMap();
|
|
7153
|
+
function markDirty(set3, mock) {
|
|
7154
|
+
let ref = MOCK_REFS.get(mock);
|
|
7155
|
+
if (!ref) {
|
|
7156
|
+
ref = new WeakRef(mock);
|
|
7157
|
+
MOCK_REFS.set(mock, ref);
|
|
7158
|
+
MOCK_FINALIZER.register(mock, ref);
|
|
7159
|
+
}
|
|
7160
|
+
addToSet.call(set3, ref);
|
|
7161
|
+
}
|
|
7162
|
+
function unmarkDirty(set3, mock) {
|
|
7163
|
+
const ref = MOCK_REFS.get(mock);
|
|
7164
|
+
if (ref) set3.delete(ref);
|
|
7165
|
+
}
|
|
7166
|
+
function forEachDirty(set3, fn2) {
|
|
7167
|
+
for (const ref of set3) {
|
|
7168
|
+
const mock = ref.deref();
|
|
7169
|
+
if (mock) fn2(mock);
|
|
7170
|
+
else set3.delete(ref);
|
|
7171
|
+
}
|
|
7172
|
+
}
|
|
6844
7173
|
function createMockInstance(options = {}) {
|
|
6845
7174
|
const { originalImplementation, restore, mockImplementation, resetToMockImplementation, resetToMockName } = options;
|
|
6846
7175
|
if (restore) MOCK_RESTORE.add(restore);
|
|
@@ -6861,9 +7190,6 @@ function createMockInstance(options = {}) {
|
|
|
6861
7190
|
if (resetToMockName) config2.mockName = mock.name || "vi.fn()";
|
|
6862
7191
|
MOCK_CONFIGS.set(mock, config2);
|
|
6863
7192
|
MOCKS_BY_STATE.set(state, mock);
|
|
6864
|
-
const ref = new WeakRef(mock);
|
|
6865
|
-
REGISTERED_MOCKS.add(ref);
|
|
6866
|
-
MOCK_FINALIZER.register(mock, ref);
|
|
6867
7193
|
mock._isMockFunction = true;
|
|
6868
7194
|
mock.getMockImplementation = () => {
|
|
6869
7195
|
return config2.onceMockImplementations[0] || config2.mockImplementation;
|
|
@@ -6878,21 +7204,25 @@ function createMockInstance(options = {}) {
|
|
|
6878
7204
|
value: state
|
|
6879
7205
|
});
|
|
6880
7206
|
mock.mockImplementation = function mockImplementation2(implementation) {
|
|
7207
|
+
markDirty(DIRTY_MOCK_CONFIGS, mock);
|
|
6881
7208
|
config2.mockImplementation = implementation;
|
|
6882
7209
|
updateMockPrototype();
|
|
6883
7210
|
return mock;
|
|
6884
7211
|
};
|
|
6885
7212
|
mock.mockImplementationOnce = function mockImplementationOnce(implementation) {
|
|
7213
|
+
markDirty(DIRTY_MOCK_CONFIGS, mock);
|
|
6886
7214
|
config2.onceMockImplementations.push(implementation);
|
|
6887
7215
|
updateMockPrototype();
|
|
6888
7216
|
return mock;
|
|
6889
7217
|
};
|
|
6890
7218
|
mock.withImplementation = function withImplementation(implementation, callback) {
|
|
7219
|
+
markDirty(DIRTY_MOCK_CONFIGS, mock);
|
|
6891
7220
|
const previousImplementation = config2.mockImplementation;
|
|
6892
7221
|
const previousOnceImplementations = config2.onceMockImplementations;
|
|
6893
7222
|
const reset = () => {
|
|
6894
7223
|
config2.mockImplementation = previousImplementation;
|
|
6895
7224
|
config2.onceMockImplementations = previousOnceImplementations;
|
|
7225
|
+
markDirty(DIRTY_MOCK_CONFIGS, mock);
|
|
6896
7226
|
updateMockPrototype();
|
|
6897
7227
|
};
|
|
6898
7228
|
config2.mockImplementation = implementation;
|
|
@@ -6964,7 +7294,7 @@ function createMockInstance(options = {}) {
|
|
|
6964
7294
|
state.invocationCallOrder = [];
|
|
6965
7295
|
state.results = [];
|
|
6966
7296
|
state.settledResults = [];
|
|
6967
|
-
DIRTY_MOCK_STATES
|
|
7297
|
+
unmarkDirty(DIRTY_MOCK_STATES, mock);
|
|
6968
7298
|
return mock;
|
|
6969
7299
|
};
|
|
6970
7300
|
mock.mockReset = function mockReset() {
|
|
@@ -6972,6 +7302,7 @@ function createMockInstance(options = {}) {
|
|
|
6972
7302
|
config2.mockImplementation = resetToMockImplementation ? mockImplementation : void 0;
|
|
6973
7303
|
config2.mockName = resetToMockName ? mock.name || "vi.fn()" : "vi.fn()";
|
|
6974
7304
|
config2.onceMockImplementations = [];
|
|
7305
|
+
unmarkDirty(DIRTY_MOCK_CONFIGS, mock);
|
|
6975
7306
|
updateMockPrototype();
|
|
6976
7307
|
return mock;
|
|
6977
7308
|
};
|
|
@@ -6980,7 +7311,10 @@ function createMockInstance(options = {}) {
|
|
|
6980
7311
|
return restore?.();
|
|
6981
7312
|
};
|
|
6982
7313
|
mock.mockName = function mockName(name) {
|
|
6983
|
-
if (typeof name === "string")
|
|
7314
|
+
if (typeof name === "string") {
|
|
7315
|
+
markDirty(DIRTY_MOCK_CONFIGS, mock);
|
|
7316
|
+
config2.mockName = name;
|
|
7317
|
+
}
|
|
6984
7318
|
return mock;
|
|
6985
7319
|
};
|
|
6986
7320
|
mock.getMockName = function getMockName() {
|
|
@@ -7077,9 +7411,9 @@ function createMock({ state, config: config2, name: mockName, prototypeState, pr
|
|
|
7077
7411
|
const prototypeMock = prototypeState && MOCKS_BY_STATE.get(prototypeState);
|
|
7078
7412
|
const namedObject = {
|
|
7079
7413
|
// to keep the name of the function intact
|
|
7080
|
-
[name]:
|
|
7081
|
-
|
|
7082
|
-
if (prototypeMock)
|
|
7414
|
+
[name]: function(...args) {
|
|
7415
|
+
markDirty(DIRTY_MOCK_STATES, namedObject[name]);
|
|
7416
|
+
if (prototypeMock) markDirty(DIRTY_MOCK_STATES, prototypeMock);
|
|
7083
7417
|
registerCalls(args, state, prototypeState);
|
|
7084
7418
|
registerInvocationOrder(invocationCallCounter++, state, prototypeState);
|
|
7085
7419
|
const result = {
|
|
@@ -7101,8 +7435,11 @@ function createMock({ state, config: config2, name: mockName, prototypeState, pr
|
|
|
7101
7435
|
let didThrow = false;
|
|
7102
7436
|
try {
|
|
7103
7437
|
if (new.target) {
|
|
7104
|
-
if (prototypeMembers.length === 0)
|
|
7105
|
-
|
|
7438
|
+
if (prototypeMembers.length === 0) reparentMockPrototype(
|
|
7439
|
+
// oxlint-disable-next-line typescript/no-use-before-define
|
|
7440
|
+
mock,
|
|
7441
|
+
implementation === noopImplementation ? void 0 : implementation
|
|
7442
|
+
);
|
|
7106
7443
|
returnValue = Reflect.construct(implementation, args, new.target);
|
|
7107
7444
|
for (const prop of prototypeMembers) {
|
|
7108
7445
|
const prototypeMock2 = returnValue[prop];
|
|
@@ -7152,7 +7489,7 @@ function createMock({ state, config: config2, name: mockName, prototypeState, pr
|
|
|
7152
7489
|
}
|
|
7153
7490
|
}
|
|
7154
7491
|
return returnValue;
|
|
7155
|
-
}
|
|
7492
|
+
}
|
|
7156
7493
|
};
|
|
7157
7494
|
const mock = namedObject[name];
|
|
7158
7495
|
const copyPropertiesFrom = original || pseudoOriginal;
|
|
@@ -7245,14 +7582,11 @@ function restoreAllMocks() {
|
|
|
7245
7582
|
MOCK_RESTORE.clear();
|
|
7246
7583
|
}
|
|
7247
7584
|
function clearAllMocks() {
|
|
7248
|
-
|
|
7585
|
+
forEachDirty(DIRTY_MOCK_STATES, (mock) => mock.mockClear());
|
|
7249
7586
|
}
|
|
7250
7587
|
function resetAllMocks() {
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
if (mock) mock.mockReset();
|
|
7254
|
-
else REGISTERED_MOCKS.delete(ref);
|
|
7255
|
-
}
|
|
7588
|
+
forEachDirty(DIRTY_MOCK_STATES, (mock) => mock.mockReset());
|
|
7589
|
+
forEachDirty(DIRTY_MOCK_CONFIGS, (mock) => mock.mockReset());
|
|
7256
7590
|
}
|
|
7257
7591
|
function throwConstructorError(shorthand) {
|
|
7258
7592
|
throw new TypeError(`Cannot use \`${shorthand}\` when called with \`new\`. Use \`mockImplementation\` with a \`class\` keyword instead. See https://vitest.dev/api/mock#class-support for more information.`);
|
|
@@ -7332,6 +7666,9 @@ function compatibleConstructor(thrown, errorLike) {
|
|
|
7332
7666
|
__name(compatibleConstructor, "compatibleConstructor");
|
|
7333
7667
|
function compatibleMessage(thrown, errMatcher) {
|
|
7334
7668
|
const comparisonString = typeof thrown === "string" ? thrown : thrown.message;
|
|
7669
|
+
if (comparisonString === void 0) {
|
|
7670
|
+
return false;
|
|
7671
|
+
}
|
|
7335
7672
|
if (isRegExp(errMatcher)) {
|
|
7336
7673
|
return errMatcher.test(comparisonString);
|
|
7337
7674
|
} else if (typeof errMatcher === "string") {
|
|
@@ -7385,7 +7722,10 @@ function type(obj) {
|
|
|
7385
7722
|
if (obj === null) {
|
|
7386
7723
|
return "null";
|
|
7387
7724
|
}
|
|
7388
|
-
const stringTag =
|
|
7725
|
+
const stringTag = (
|
|
7726
|
+
/** @type {Record<PropertyKey, unknown>} */
|
|
7727
|
+
obj[Symbol.toStringTag]
|
|
7728
|
+
);
|
|
7389
7729
|
if (typeof stringTag === "string") {
|
|
7390
7730
|
return stringTag;
|
|
7391
7731
|
}
|
|
@@ -7428,17 +7768,21 @@ __name(_AssertionError, "AssertionError");
|
|
|
7428
7768
|
var AssertionError = _AssertionError;
|
|
7429
7769
|
function expectTypes(obj, types) {
|
|
7430
7770
|
let flagMsg = flag(obj, "message");
|
|
7431
|
-
let ssfi =
|
|
7771
|
+
let ssfi = (
|
|
7772
|
+
/** @type {Function} */
|
|
7773
|
+
flag(obj, "ssfi")
|
|
7774
|
+
);
|
|
7432
7775
|
flagMsg = flagMsg ? flagMsg + ": " : "";
|
|
7433
|
-
obj =
|
|
7434
|
-
|
|
7435
|
-
|
|
7776
|
+
obj = /** @type {object} */
|
|
7777
|
+
flag(obj, "object");
|
|
7778
|
+
types = types.map(function(t3) {
|
|
7779
|
+
return t3.toLowerCase();
|
|
7436
7780
|
});
|
|
7437
7781
|
types.sort();
|
|
7438
|
-
let str = types.map(function(
|
|
7439
|
-
let art = ~["a", "e", "i", "o", "u"].indexOf(
|
|
7440
|
-
let or = types.length > 1 &&
|
|
7441
|
-
return or + art + " " +
|
|
7782
|
+
let str = types.map(function(t3, index2) {
|
|
7783
|
+
let art = ~["a", "e", "i", "o", "u"].indexOf(t3.charAt(0)) ? "an" : "a";
|
|
7784
|
+
let or = types.length > 1 && index2 === types.length - 1 ? "or " : "";
|
|
7785
|
+
return or + art + " " + t3;
|
|
7442
7786
|
}).join(", ");
|
|
7443
7787
|
let objType = type(obj).toLowerCase();
|
|
7444
7788
|
if (!types.some(function(expected) {
|
|
@@ -8127,11 +8471,23 @@ function objDisplay(obj) {
|
|
|
8127
8471
|
let str = inspect22(obj), type3 = Object.prototype.toString.call(obj);
|
|
8128
8472
|
if (config.truncateThreshold && str.length >= config.truncateThreshold) {
|
|
8129
8473
|
if (type3 === "[object Function]") {
|
|
8130
|
-
|
|
8474
|
+
const objAsFunction = (
|
|
8475
|
+
/** @type {Function} */
|
|
8476
|
+
obj
|
|
8477
|
+
);
|
|
8478
|
+
return !objAsFunction.name || objAsFunction.name === "" ? "[Function]" : "[Function: " + objAsFunction.name + "]";
|
|
8131
8479
|
} else if (type3 === "[object Array]") {
|
|
8132
|
-
|
|
8480
|
+
const objAsArray = (
|
|
8481
|
+
/** @type {unknown[]} */
|
|
8482
|
+
obj
|
|
8483
|
+
);
|
|
8484
|
+
return "[ Array(" + objAsArray.length + ") ]";
|
|
8133
8485
|
} else if (type3 === "[object Object]") {
|
|
8134
|
-
|
|
8486
|
+
const objAsObject = (
|
|
8487
|
+
/** @type {Record<PropertyKey, unknown>} */
|
|
8488
|
+
obj
|
|
8489
|
+
);
|
|
8490
|
+
let keys2 = Object.keys(objAsObject), kstr = keys2.length > 2 ? keys2.splice(0, 2).join(", ") + ", ..." : keys2.join(", ");
|
|
8135
8491
|
return "{ Object (" + kstr + ") }";
|
|
8136
8492
|
} else {
|
|
8137
8493
|
return str;
|
|
@@ -8146,29 +8502,40 @@ function getMessage2(obj, args) {
|
|
|
8146
8502
|
let val = flag(obj, "object");
|
|
8147
8503
|
let expected = args[3];
|
|
8148
8504
|
let actual = getActual(obj, args);
|
|
8149
|
-
let
|
|
8505
|
+
let rawMsg = negate ? args[2] : args[1];
|
|
8150
8506
|
let flagMsg = flag(obj, "message");
|
|
8151
|
-
if (typeof
|
|
8152
|
-
|
|
8153
|
-
|
|
8154
|
-
|
|
8155
|
-
|
|
8156
|
-
|
|
8157
|
-
|
|
8507
|
+
if (typeof rawMsg === "function") rawMsg = rawMsg();
|
|
8508
|
+
const template = (
|
|
8509
|
+
/** @type {string} */
|
|
8510
|
+
rawMsg || ""
|
|
8511
|
+
);
|
|
8512
|
+
const msg = template.replace(/#\{(this|act|exp)\}/g, function(_2, tag) {
|
|
8513
|
+
if (tag === "this") {
|
|
8514
|
+
return objDisplay(val);
|
|
8515
|
+
}
|
|
8516
|
+
if (tag === "act") {
|
|
8517
|
+
return objDisplay(actual);
|
|
8518
|
+
}
|
|
8158
8519
|
return objDisplay(expected);
|
|
8159
8520
|
});
|
|
8160
8521
|
return flagMsg ? flagMsg + ": " + msg : msg;
|
|
8161
8522
|
}
|
|
8162
8523
|
__name(getMessage2, "getMessage");
|
|
8163
|
-
function transferFlags(
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8524
|
+
function transferFlags(source, object2, includeAll) {
|
|
8525
|
+
const sourceWithFlags = (
|
|
8526
|
+
/** @type {{__flags?: Record<PropertyKey, unknown>}} */
|
|
8527
|
+
source
|
|
8528
|
+
);
|
|
8529
|
+
const objWithFlags = (
|
|
8530
|
+
/** @type {{__flags?: Record<PropertyKey, unknown>}} */
|
|
8531
|
+
object2
|
|
8532
|
+
);
|
|
8533
|
+
let flags = sourceWithFlags.__flags || (sourceWithFlags.__flags = /* @__PURE__ */ Object.create(null));
|
|
8534
|
+
const objFlags = objWithFlags.__flags || (objWithFlags.__flags = /* @__PURE__ */ Object.create(null));
|
|
8168
8535
|
includeAll = arguments.length === 3 ? includeAll : true;
|
|
8169
8536
|
for (let flag3 in flags) {
|
|
8170
8537
|
if (includeAll || flag3 !== "object" && flag3 !== "ssfi" && flag3 !== "lockSsfi" && flag3 != "message") {
|
|
8171
|
-
|
|
8538
|
+
objFlags[flag3] = flags[flag3];
|
|
8172
8539
|
}
|
|
8173
8540
|
}
|
|
8174
8541
|
}
|
|
@@ -8386,9 +8753,9 @@ function iterableEqual(leftHandOperand, rightHandOperand, options) {
|
|
|
8386
8753
|
if (length === 0) {
|
|
8387
8754
|
return true;
|
|
8388
8755
|
}
|
|
8389
|
-
var
|
|
8390
|
-
while (++
|
|
8391
|
-
if (deepEqual(leftHandOperand[
|
|
8756
|
+
var index2 = -1;
|
|
8757
|
+
while (++index2 < length) {
|
|
8758
|
+
if (deepEqual(leftHandOperand[index2], rightHandOperand[index2], options) === false) {
|
|
8392
8759
|
return false;
|
|
8393
8760
|
}
|
|
8394
8761
|
}
|
|
@@ -8586,9 +8953,9 @@ var _Assertion = class _Assertion2 {
|
|
|
8586
8953
|
* - `eql`: This flag contains the deepEqual function to be used by the assertion.
|
|
8587
8954
|
*
|
|
8588
8955
|
* @param {unknown} obj target of the assertion
|
|
8589
|
-
* @param {string}
|
|
8590
|
-
* @param {Function}
|
|
8591
|
-
* @param {boolean}
|
|
8956
|
+
* @param {string=} msg (optional) custom error message
|
|
8957
|
+
* @param {Function=} ssfi (optional) starting point for removing stack frames
|
|
8958
|
+
* @param {boolean=} lockSsfi (optional) whether or not the ssfi flag is locked
|
|
8592
8959
|
*/
|
|
8593
8960
|
constructor(obj, msg, ssfi, lockSsfi) {
|
|
8594
8961
|
__publicField2(this, "__flags", {});
|
|
@@ -8629,44 +8996,44 @@ var _Assertion = class _Assertion2 {
|
|
|
8629
8996
|
}
|
|
8630
8997
|
/**
|
|
8631
8998
|
* @param {string} name
|
|
8632
|
-
* @param {
|
|
8999
|
+
* @param {(...args: never) => unknown} fn
|
|
8633
9000
|
*/
|
|
8634
9001
|
static addProperty(name, fn2) {
|
|
8635
9002
|
addProperty(this.prototype, name, fn2);
|
|
8636
9003
|
}
|
|
8637
9004
|
/**
|
|
8638
9005
|
* @param {string} name
|
|
8639
|
-
* @param {
|
|
9006
|
+
* @param {(...args: never) => unknown} fn
|
|
8640
9007
|
*/
|
|
8641
9008
|
static addMethod(name, fn2) {
|
|
8642
9009
|
addMethod(this.prototype, name, fn2);
|
|
8643
9010
|
}
|
|
8644
9011
|
/**
|
|
8645
9012
|
* @param {string} name
|
|
8646
|
-
* @param {
|
|
8647
|
-
* @param {
|
|
9013
|
+
* @param {(...args: never) => unknown} fn
|
|
9014
|
+
* @param {(...args: never) => unknown} chainingBehavior
|
|
8648
9015
|
*/
|
|
8649
9016
|
static addChainableMethod(name, fn2, chainingBehavior) {
|
|
8650
9017
|
addChainableMethod(this.prototype, name, fn2, chainingBehavior);
|
|
8651
9018
|
}
|
|
8652
9019
|
/**
|
|
8653
9020
|
* @param {string} name
|
|
8654
|
-
* @param {
|
|
9021
|
+
* @param {(...args: never) => unknown} fn
|
|
8655
9022
|
*/
|
|
8656
9023
|
static overwriteProperty(name, fn2) {
|
|
8657
9024
|
overwriteProperty(this.prototype, name, fn2);
|
|
8658
9025
|
}
|
|
8659
9026
|
/**
|
|
8660
9027
|
* @param {string} name
|
|
8661
|
-
* @param {
|
|
9028
|
+
* @param {(...args: never) => unknown} fn
|
|
8662
9029
|
*/
|
|
8663
9030
|
static overwriteMethod(name, fn2) {
|
|
8664
9031
|
overwriteMethod(this.prototype, name, fn2);
|
|
8665
9032
|
}
|
|
8666
9033
|
/**
|
|
8667
9034
|
* @param {string} name
|
|
8668
|
-
* @param {
|
|
8669
|
-
* @param {
|
|
9035
|
+
* @param {(...args: never) => unknown} fn
|
|
9036
|
+
* @param {(...args: never) => unknown} chainingBehavior
|
|
8670
9037
|
*/
|
|
8671
9038
|
static overwriteChainableMethod(name, fn2, chainingBehavior) {
|
|
8672
9039
|
overwriteChainableMethod(this.prototype, name, fn2, chainingBehavior);
|
|
@@ -8705,7 +9072,6 @@ var _Assertion = class _Assertion2 {
|
|
|
8705
9072
|
throw new AssertionError(
|
|
8706
9073
|
msg,
|
|
8707
9074
|
assertionErrorObjectProperties,
|
|
8708
|
-
// @ts-expect-error Not sure what to do about these types yet
|
|
8709
9075
|
config.includeStack ? this.assert : flag(this, "ssfi")
|
|
8710
9076
|
);
|
|
8711
9077
|
}
|
|
@@ -8731,6 +9097,11 @@ __name(_Assertion, "Assertion");
|
|
|
8731
9097
|
var Assertion = _Assertion;
|
|
8732
9098
|
var events = new EventTarget();
|
|
8733
9099
|
var _PluginEvent = class _PluginEvent2 extends Event {
|
|
9100
|
+
/**
|
|
9101
|
+
* @param {string} type
|
|
9102
|
+
* @param {string} name
|
|
9103
|
+
* @param {Function} fn
|
|
9104
|
+
*/
|
|
8734
9105
|
constructor(type3, name, fn2) {
|
|
8735
9106
|
super(type3);
|
|
8736
9107
|
this.name = String(name);
|
|
@@ -8765,7 +9136,7 @@ __name(addProperty, "addProperty");
|
|
|
8765
9136
|
var fnLengthDesc = Object.getOwnPropertyDescriptor(function() {
|
|
8766
9137
|
}, "length");
|
|
8767
9138
|
function addLengthGuard(fn2, assertionName, isChainable) {
|
|
8768
|
-
if (!fnLengthDesc
|
|
9139
|
+
if (!fnLengthDesc?.configurable) return fn2;
|
|
8769
9140
|
Object.defineProperty(fn2, "length", {
|
|
8770
9141
|
get: /* @__PURE__ */ __name(function() {
|
|
8771
9142
|
if (isChainable) {
|
|
@@ -8805,7 +9176,7 @@ function proxify(obj, nonChainableMethodName) {
|
|
|
8805
9176
|
if (typeof property === "string" && config.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) {
|
|
8806
9177
|
if (nonChainableMethodName) {
|
|
8807
9178
|
throw Error(
|
|
8808
|
-
"Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".'
|
|
9179
|
+
"Invalid Chai property: " + String(nonChainableMethodName) + "." + property + '. See docs for proper usage of "' + String(nonChainableMethodName) + '".'
|
|
8809
9180
|
);
|
|
8810
9181
|
}
|
|
8811
9182
|
let suggestion = null;
|
|
@@ -8880,12 +9251,17 @@ function addMethod(ctx, name, method) {
|
|
|
8880
9251
|
return newAssertion;
|
|
8881
9252
|
}, "methodWrapper");
|
|
8882
9253
|
addLengthGuard(methodWrapper, name, false);
|
|
8883
|
-
ctx[name] = proxify(
|
|
9254
|
+
ctx[name] = proxify(
|
|
9255
|
+
methodWrapper,
|
|
9256
|
+
name
|
|
9257
|
+
);
|
|
8884
9258
|
events.dispatchEvent(new PluginEvent("addMethod", name, method));
|
|
8885
9259
|
}
|
|
8886
9260
|
__name(addMethod, "addMethod");
|
|
8887
9261
|
function overwriteProperty(ctx, name, getter) {
|
|
8888
|
-
let _get = Object.getOwnPropertyDescriptor(ctx, name)
|
|
9262
|
+
let _get = Object.getOwnPropertyDescriptor(ctx, name);
|
|
9263
|
+
let _super = /* @__PURE__ */ __name(function() {
|
|
9264
|
+
return;
|
|
8889
9265
|
}, "_super");
|
|
8890
9266
|
if (_get && "function" === typeof _get.get) _super = _get.get;
|
|
8891
9267
|
Object.defineProperty(ctx, name, {
|
|
@@ -8909,11 +9285,15 @@ function overwriteProperty(ctx, name, getter) {
|
|
|
8909
9285
|
}
|
|
8910
9286
|
__name(overwriteProperty, "overwriteProperty");
|
|
8911
9287
|
function overwriteMethod(ctx, name, method) {
|
|
8912
|
-
let _method =
|
|
8913
|
-
|
|
9288
|
+
let _method = (
|
|
9289
|
+
/** @type {Record<PropertyKey, unknown>} */
|
|
9290
|
+
ctx[name]
|
|
9291
|
+
);
|
|
9292
|
+
let _super = /* @__PURE__ */ __name(function() {
|
|
9293
|
+
throw new Error(String(name) + " is not a function");
|
|
8914
9294
|
}, "_super");
|
|
8915
9295
|
if (_method && "function" === typeof _method) _super = _method;
|
|
8916
|
-
|
|
9296
|
+
function overwritingMethodWrapper() {
|
|
8917
9297
|
if (!flag(this, "lockSsfi")) {
|
|
8918
9298
|
flag(this, "ssfi", overwritingMethodWrapper);
|
|
8919
9299
|
}
|
|
@@ -8927,9 +9307,13 @@ function overwriteMethod(ctx, name, method) {
|
|
|
8927
9307
|
let newAssertion = new Assertion();
|
|
8928
9308
|
transferFlags(this, newAssertion);
|
|
8929
9309
|
return newAssertion;
|
|
8930
|
-
}
|
|
8931
|
-
|
|
8932
|
-
|
|
9310
|
+
}
|
|
9311
|
+
__name(overwritingMethodWrapper, "overwritingMethodWrapper");
|
|
9312
|
+
addLengthGuard(overwritingMethodWrapper, String(name), false);
|
|
9313
|
+
ctx[name] = proxify(
|
|
9314
|
+
overwritingMethodWrapper,
|
|
9315
|
+
name
|
|
9316
|
+
);
|
|
8933
9317
|
}
|
|
8934
9318
|
__name(overwriteMethod, "overwriteMethod");
|
|
8935
9319
|
var canSetPrototype = typeof Object.setPrototypeOf === "function";
|
|
@@ -8943,6 +9327,12 @@ var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
|
|
|
8943
9327
|
var call = Function.prototype.call;
|
|
8944
9328
|
var apply = Function.prototype.apply;
|
|
8945
9329
|
var _PluginAddChainableMethodEvent = class _PluginAddChainableMethodEvent2 extends PluginEvent {
|
|
9330
|
+
/**
|
|
9331
|
+
* @param {string} type
|
|
9332
|
+
* @param {string} name
|
|
9333
|
+
* @param {Function} fn
|
|
9334
|
+
* @param {Function} chainingBehavior
|
|
9335
|
+
*/
|
|
8946
9336
|
constructor(type3, name, fn2, chainingBehavior) {
|
|
8947
9337
|
super(type3, name, fn2);
|
|
8948
9338
|
this.chainingBehavior = chainingBehavior;
|
|
@@ -8951,6 +9341,10 @@ var _PluginAddChainableMethodEvent = class _PluginAddChainableMethodEvent2 exten
|
|
|
8951
9341
|
__name(_PluginAddChainableMethodEvent, "PluginAddChainableMethodEvent");
|
|
8952
9342
|
var PluginAddChainableMethodEvent = _PluginAddChainableMethodEvent;
|
|
8953
9343
|
function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
9344
|
+
const ctxChainable = (
|
|
9345
|
+
/** @type {T & {__methods: Record<PropertyKey, ChainableBehavior>}} */
|
|
9346
|
+
ctx
|
|
9347
|
+
);
|
|
8954
9348
|
if (typeof chainingBehavior !== "function") {
|
|
8955
9349
|
chainingBehavior = /* @__PURE__ */ __name(function() {
|
|
8956
9350
|
}, "chainingBehavior");
|
|
@@ -8959,25 +9353,29 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
8959
9353
|
method,
|
|
8960
9354
|
chainingBehavior
|
|
8961
9355
|
};
|
|
8962
|
-
if (!
|
|
8963
|
-
|
|
9356
|
+
if (!ctxChainable.__methods) {
|
|
9357
|
+
ctxChainable.__methods = {};
|
|
8964
9358
|
}
|
|
8965
|
-
|
|
9359
|
+
ctxChainable.__methods[name] = chainableBehavior;
|
|
8966
9360
|
Object.defineProperty(ctx, name, {
|
|
8967
9361
|
get: /* @__PURE__ */ __name(function chainableMethodGetter() {
|
|
8968
9362
|
chainableBehavior.chainingBehavior.call(this);
|
|
8969
|
-
|
|
9363
|
+
function chainableMethodWrapper(...args) {
|
|
8970
9364
|
if (!flag(this, "lockSsfi")) {
|
|
8971
9365
|
flag(this, "ssfi", chainableMethodWrapper);
|
|
8972
9366
|
}
|
|
8973
|
-
let result =
|
|
9367
|
+
let result = (
|
|
9368
|
+
/** @type {(...args: unknown[]) => unknown} */
|
|
9369
|
+
chainableBehavior.method.apply(this, args)
|
|
9370
|
+
);
|
|
8974
9371
|
if (result !== void 0) {
|
|
8975
9372
|
return result;
|
|
8976
9373
|
}
|
|
8977
9374
|
let newAssertion = new Assertion();
|
|
8978
9375
|
transferFlags(this, newAssertion);
|
|
8979
9376
|
return newAssertion;
|
|
8980
|
-
}
|
|
9377
|
+
}
|
|
9378
|
+
__name(chainableMethodWrapper, "chainableMethodWrapper");
|
|
8981
9379
|
addLengthGuard(chainableMethodWrapper, name, true);
|
|
8982
9380
|
if (canSetPrototype) {
|
|
8983
9381
|
let prototype = Object.create(this);
|
|
@@ -8991,7 +9389,9 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
8991
9389
|
return;
|
|
8992
9390
|
}
|
|
8993
9391
|
let pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
|
8994
|
-
|
|
9392
|
+
if (pd) {
|
|
9393
|
+
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
|
9394
|
+
}
|
|
8995
9395
|
});
|
|
8996
9396
|
}
|
|
8997
9397
|
transferFlags(this, chainableMethodWrapper);
|
|
@@ -9010,9 +9410,15 @@ function addChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
9010
9410
|
}
|
|
9011
9411
|
__name(addChainableMethod, "addChainableMethod");
|
|
9012
9412
|
function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
|
9013
|
-
let chainableBehavior =
|
|
9413
|
+
let chainableBehavior = (
|
|
9414
|
+
/** @type {{__methods: Record<PropertyKey, ChainableBehavior>}} */
|
|
9415
|
+
ctx.__methods[name]
|
|
9416
|
+
);
|
|
9014
9417
|
let _chainingBehavior = chainableBehavior.chainingBehavior;
|
|
9015
|
-
chainableBehavior.chainingBehavior =
|
|
9418
|
+
chainableBehavior.chainingBehavior = /**
|
|
9419
|
+
* @this {T}
|
|
9420
|
+
*/
|
|
9421
|
+
/* @__PURE__ */ __name(function overwritingChainableMethodGetter() {
|
|
9016
9422
|
let result = chainingBehavior(_chainingBehavior).call(this);
|
|
9017
9423
|
if (result !== void 0) {
|
|
9018
9424
|
return result;
|
|
@@ -9033,19 +9439,24 @@ function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
9033
9439
|
}, "overwritingChainableMethodWrapper");
|
|
9034
9440
|
}
|
|
9035
9441
|
__name(overwriteChainableMethod, "overwriteChainableMethod");
|
|
9036
|
-
function compareByInspect(
|
|
9037
|
-
return inspect22(
|
|
9442
|
+
function compareByInspect(a, b2) {
|
|
9443
|
+
return inspect22(a) < inspect22(b2) ? -1 : 1;
|
|
9038
9444
|
}
|
|
9039
9445
|
__name(compareByInspect, "compareByInspect");
|
|
9040
9446
|
function getOwnEnumerablePropertySymbols(obj) {
|
|
9041
9447
|
if (typeof Object.getOwnPropertySymbols !== "function") return [];
|
|
9042
9448
|
return Object.getOwnPropertySymbols(obj).filter(function(sym) {
|
|
9043
|
-
return Object.getOwnPropertyDescriptor(obj, sym)
|
|
9449
|
+
return Object.getOwnPropertyDescriptor(obj, sym)?.enumerable;
|
|
9044
9450
|
});
|
|
9045
9451
|
}
|
|
9046
9452
|
__name(getOwnEnumerablePropertySymbols, "getOwnEnumerablePropertySymbols");
|
|
9047
9453
|
function getOwnEnumerableProperties(obj) {
|
|
9048
|
-
return
|
|
9454
|
+
return (
|
|
9455
|
+
/** @type {PropertyKey[]} */
|
|
9456
|
+
Object.keys(obj).concat(
|
|
9457
|
+
getOwnEnumerablePropertySymbols(obj)
|
|
9458
|
+
)
|
|
9459
|
+
);
|
|
9049
9460
|
}
|
|
9050
9461
|
__name(getOwnEnumerableProperties, "getOwnEnumerableProperties");
|
|
9051
9462
|
var isNaN2 = Number.isNaN;
|
|
@@ -9061,18 +9472,19 @@ function getOperator(obj, args) {
|
|
|
9061
9472
|
let expected = args[3];
|
|
9062
9473
|
let msg = negate ? args[2] : args[1];
|
|
9063
9474
|
if (operator) {
|
|
9064
|
-
return operator;
|
|
9475
|
+
return String(operator);
|
|
9065
9476
|
}
|
|
9066
9477
|
if (typeof msg === "function") msg = msg();
|
|
9067
9478
|
msg = msg || "";
|
|
9068
9479
|
if (!msg) {
|
|
9069
9480
|
return void 0;
|
|
9070
9481
|
}
|
|
9071
|
-
|
|
9482
|
+
const msgString = String(msg);
|
|
9483
|
+
if (/\shave\s/.test(msgString)) {
|
|
9072
9484
|
return void 0;
|
|
9073
9485
|
}
|
|
9074
9486
|
let isObject3 = isObjectType(expected);
|
|
9075
|
-
if (/\snot\s/.test(
|
|
9487
|
+
if (/\snot\s/.test(msgString)) {
|
|
9076
9488
|
return isObject3 ? "notDeepStrictEqual" : "notStrictEqual";
|
|
9077
9489
|
}
|
|
9078
9490
|
return isObject3 ? "deepStrictEqual" : "strictEqual";
|
|
@@ -9168,8 +9580,8 @@ function an(type3, msg) {
|
|
|
9168
9580
|
__name(an, "an");
|
|
9169
9581
|
Assertion.addChainableMethod("an", an);
|
|
9170
9582
|
Assertion.addChainableMethod("a", an);
|
|
9171
|
-
function SameValueZero(
|
|
9172
|
-
return isNaN2(
|
|
9583
|
+
function SameValueZero(a, b2) {
|
|
9584
|
+
return isNaN2(a) && isNaN2(b2) || a === b2;
|
|
9173
9585
|
}
|
|
9174
9586
|
__name(SameValueZero, "SameValueZero");
|
|
9175
9587
|
function includeChainingBehavior() {
|
|
@@ -9433,9 +9845,9 @@ function assertEql(obj, msg) {
|
|
|
9433
9845
|
__name(assertEql, "assertEql");
|
|
9434
9846
|
Assertion.addMethod("eql", assertEql);
|
|
9435
9847
|
Assertion.addMethod("eqls", assertEql);
|
|
9436
|
-
function assertAbove(
|
|
9848
|
+
function assertAbove(n2, msg) {
|
|
9437
9849
|
if (msg) flag2(this, "message", msg);
|
|
9438
|
-
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(
|
|
9850
|
+
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(n2).toLowerCase();
|
|
9439
9851
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
9440
9852
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
9441
9853
|
}
|
|
@@ -9445,7 +9857,7 @@ function assertAbove(n3, msg) {
|
|
|
9445
9857
|
void 0,
|
|
9446
9858
|
ssfi
|
|
9447
9859
|
);
|
|
9448
|
-
} else if (!isNumeric(
|
|
9860
|
+
} else if (!isNumeric(n2) && (doLength || isNumeric(obj))) {
|
|
9449
9861
|
throw new AssertionError(
|
|
9450
9862
|
msgPrefix + "the argument to above must be a number",
|
|
9451
9863
|
void 0,
|
|
@@ -9468,18 +9880,18 @@ function assertAbove(n3, msg) {
|
|
|
9468
9880
|
itemsCount = obj.length;
|
|
9469
9881
|
}
|
|
9470
9882
|
this.assert(
|
|
9471
|
-
itemsCount >
|
|
9883
|
+
itemsCount > n2,
|
|
9472
9884
|
"expected #{this} to have a " + descriptor + " above #{exp} but got #{act}",
|
|
9473
9885
|
"expected #{this} to not have a " + descriptor + " above #{exp}",
|
|
9474
|
-
|
|
9886
|
+
n2,
|
|
9475
9887
|
itemsCount
|
|
9476
9888
|
);
|
|
9477
9889
|
} else {
|
|
9478
9890
|
this.assert(
|
|
9479
|
-
obj >
|
|
9891
|
+
obj > n2,
|
|
9480
9892
|
"expected #{this} to be above #{exp}",
|
|
9481
9893
|
"expected #{this} to be at most #{exp}",
|
|
9482
|
-
|
|
9894
|
+
n2
|
|
9483
9895
|
);
|
|
9484
9896
|
}
|
|
9485
9897
|
}
|
|
@@ -9487,15 +9899,15 @@ __name(assertAbove, "assertAbove");
|
|
|
9487
9899
|
Assertion.addMethod("above", assertAbove);
|
|
9488
9900
|
Assertion.addMethod("gt", assertAbove);
|
|
9489
9901
|
Assertion.addMethod("greaterThan", assertAbove);
|
|
9490
|
-
function assertLeast(
|
|
9902
|
+
function assertLeast(n2, msg) {
|
|
9491
9903
|
if (msg) flag2(this, "message", msg);
|
|
9492
|
-
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(
|
|
9904
|
+
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(n2).toLowerCase(), errorMessage, shouldThrow = true;
|
|
9493
9905
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
9494
9906
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
9495
9907
|
}
|
|
9496
9908
|
if (!doLength && objType === "date" && nType !== "date") {
|
|
9497
9909
|
errorMessage = msgPrefix + "the argument to least must be a date";
|
|
9498
|
-
} else if (!isNumeric(
|
|
9910
|
+
} else if (!isNumeric(n2) && (doLength || isNumeric(obj))) {
|
|
9499
9911
|
errorMessage = msgPrefix + "the argument to least must be a number";
|
|
9500
9912
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
9501
9913
|
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
@@ -9515,18 +9927,18 @@ function assertLeast(n3, msg) {
|
|
|
9515
9927
|
itemsCount = obj.length;
|
|
9516
9928
|
}
|
|
9517
9929
|
this.assert(
|
|
9518
|
-
itemsCount >=
|
|
9930
|
+
itemsCount >= n2,
|
|
9519
9931
|
"expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}",
|
|
9520
9932
|
"expected #{this} to have a " + descriptor + " below #{exp}",
|
|
9521
|
-
|
|
9933
|
+
n2,
|
|
9522
9934
|
itemsCount
|
|
9523
9935
|
);
|
|
9524
9936
|
} else {
|
|
9525
9937
|
this.assert(
|
|
9526
|
-
obj >=
|
|
9938
|
+
obj >= n2,
|
|
9527
9939
|
"expected #{this} to be at least #{exp}",
|
|
9528
9940
|
"expected #{this} to be below #{exp}",
|
|
9529
|
-
|
|
9941
|
+
n2
|
|
9530
9942
|
);
|
|
9531
9943
|
}
|
|
9532
9944
|
}
|
|
@@ -9534,15 +9946,15 @@ __name(assertLeast, "assertLeast");
|
|
|
9534
9946
|
Assertion.addMethod("least", assertLeast);
|
|
9535
9947
|
Assertion.addMethod("gte", assertLeast);
|
|
9536
9948
|
Assertion.addMethod("greaterThanOrEqual", assertLeast);
|
|
9537
|
-
function assertBelow(
|
|
9949
|
+
function assertBelow(n2, msg) {
|
|
9538
9950
|
if (msg) flag2(this, "message", msg);
|
|
9539
|
-
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(
|
|
9951
|
+
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(n2).toLowerCase(), errorMessage, shouldThrow = true;
|
|
9540
9952
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
9541
9953
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
9542
9954
|
}
|
|
9543
9955
|
if (!doLength && objType === "date" && nType !== "date") {
|
|
9544
9956
|
errorMessage = msgPrefix + "the argument to below must be a date";
|
|
9545
|
-
} else if (!isNumeric(
|
|
9957
|
+
} else if (!isNumeric(n2) && (doLength || isNumeric(obj))) {
|
|
9546
9958
|
errorMessage = msgPrefix + "the argument to below must be a number";
|
|
9547
9959
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
9548
9960
|
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
@@ -9562,18 +9974,18 @@ function assertBelow(n3, msg) {
|
|
|
9562
9974
|
itemsCount = obj.length;
|
|
9563
9975
|
}
|
|
9564
9976
|
this.assert(
|
|
9565
|
-
itemsCount <
|
|
9977
|
+
itemsCount < n2,
|
|
9566
9978
|
"expected #{this} to have a " + descriptor + " below #{exp} but got #{act}",
|
|
9567
9979
|
"expected #{this} to not have a " + descriptor + " below #{exp}",
|
|
9568
|
-
|
|
9980
|
+
n2,
|
|
9569
9981
|
itemsCount
|
|
9570
9982
|
);
|
|
9571
9983
|
} else {
|
|
9572
9984
|
this.assert(
|
|
9573
|
-
obj <
|
|
9985
|
+
obj < n2,
|
|
9574
9986
|
"expected #{this} to be below #{exp}",
|
|
9575
9987
|
"expected #{this} to be at least #{exp}",
|
|
9576
|
-
|
|
9988
|
+
n2
|
|
9577
9989
|
);
|
|
9578
9990
|
}
|
|
9579
9991
|
}
|
|
@@ -9581,15 +9993,15 @@ __name(assertBelow, "assertBelow");
|
|
|
9581
9993
|
Assertion.addMethod("below", assertBelow);
|
|
9582
9994
|
Assertion.addMethod("lt", assertBelow);
|
|
9583
9995
|
Assertion.addMethod("lessThan", assertBelow);
|
|
9584
|
-
function assertMost(
|
|
9996
|
+
function assertMost(n2, msg) {
|
|
9585
9997
|
if (msg) flag2(this, "message", msg);
|
|
9586
|
-
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(
|
|
9998
|
+
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(n2).toLowerCase(), errorMessage, shouldThrow = true;
|
|
9587
9999
|
if (doLength && objType !== "map" && objType !== "set") {
|
|
9588
10000
|
new Assertion(obj, flagMsg, ssfi, true).to.have.property("length");
|
|
9589
10001
|
}
|
|
9590
10002
|
if (!doLength && objType === "date" && nType !== "date") {
|
|
9591
10003
|
errorMessage = msgPrefix + "the argument to most must be a date";
|
|
9592
|
-
} else if (!isNumeric(
|
|
10004
|
+
} else if (!isNumeric(n2) && (doLength || isNumeric(obj))) {
|
|
9593
10005
|
errorMessage = msgPrefix + "the argument to most must be a number";
|
|
9594
10006
|
} else if (!doLength && objType !== "date" && !isNumeric(obj)) {
|
|
9595
10007
|
let printObj = objType === "string" ? "'" + obj + "'" : obj;
|
|
@@ -9609,18 +10021,18 @@ function assertMost(n3, msg) {
|
|
|
9609
10021
|
itemsCount = obj.length;
|
|
9610
10022
|
}
|
|
9611
10023
|
this.assert(
|
|
9612
|
-
itemsCount <=
|
|
10024
|
+
itemsCount <= n2,
|
|
9613
10025
|
"expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}",
|
|
9614
10026
|
"expected #{this} to have a " + descriptor + " above #{exp}",
|
|
9615
|
-
|
|
10027
|
+
n2,
|
|
9616
10028
|
itemsCount
|
|
9617
10029
|
);
|
|
9618
10030
|
} else {
|
|
9619
10031
|
this.assert(
|
|
9620
|
-
obj <=
|
|
10032
|
+
obj <= n2,
|
|
9621
10033
|
"expected #{this} to be at most #{exp}",
|
|
9622
10034
|
"expected #{this} to be above #{exp}",
|
|
9623
|
-
|
|
10035
|
+
n2
|
|
9624
10036
|
);
|
|
9625
10037
|
}
|
|
9626
10038
|
}
|
|
@@ -9806,7 +10218,7 @@ function assertLengthChain() {
|
|
|
9806
10218
|
flag2(this, "doLength", true);
|
|
9807
10219
|
}
|
|
9808
10220
|
__name(assertLengthChain, "assertLengthChain");
|
|
9809
|
-
function assertLength(
|
|
10221
|
+
function assertLength(n2, msg) {
|
|
9810
10222
|
if (msg) flag2(this, "message", msg);
|
|
9811
10223
|
let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), descriptor = "length", itemsCount;
|
|
9812
10224
|
switch (objType) {
|
|
@@ -9820,10 +10232,10 @@ function assertLength(n3, msg) {
|
|
|
9820
10232
|
itemsCount = obj.length;
|
|
9821
10233
|
}
|
|
9822
10234
|
this.assert(
|
|
9823
|
-
itemsCount ==
|
|
10235
|
+
itemsCount == n2,
|
|
9824
10236
|
"expected #{this} to have a " + descriptor + " of #{exp} but got #{act}",
|
|
9825
10237
|
"expected #{this} to not have a " + descriptor + " of #{act}",
|
|
9826
|
-
|
|
10238
|
+
n2,
|
|
9827
10239
|
itemsCount
|
|
9828
10240
|
);
|
|
9829
10241
|
}
|
|
@@ -9893,21 +10305,22 @@ function assertKeys(keys2) {
|
|
|
9893
10305
|
if (!any && !all) {
|
|
9894
10306
|
all = true;
|
|
9895
10307
|
}
|
|
10308
|
+
const uniqueExpected = [...new Set(expected)];
|
|
9896
10309
|
if (any) {
|
|
9897
|
-
ok =
|
|
10310
|
+
ok = uniqueExpected.some(function(expectedKey) {
|
|
9898
10311
|
return actual.some(function(actualKey) {
|
|
9899
10312
|
return isEql(expectedKey, actualKey);
|
|
9900
10313
|
});
|
|
9901
10314
|
});
|
|
9902
10315
|
}
|
|
9903
10316
|
if (all) {
|
|
9904
|
-
ok =
|
|
10317
|
+
ok = uniqueExpected.every(function(expectedKey) {
|
|
9905
10318
|
return actual.some(function(actualKey) {
|
|
9906
10319
|
return isEql(expectedKey, actualKey);
|
|
9907
10320
|
});
|
|
9908
10321
|
});
|
|
9909
10322
|
if (!flag2(this, "contains")) {
|
|
9910
|
-
ok = ok &&
|
|
10323
|
+
ok = ok && uniqueExpected.length == actual.length;
|
|
9911
10324
|
}
|
|
9912
10325
|
}
|
|
9913
10326
|
if (len > 1) {
|
|
@@ -10177,7 +10590,7 @@ Assertion.addProperty("iterable", function(msg) {
|
|
|
10177
10590
|
if (msg) flag2(this, "message", msg);
|
|
10178
10591
|
let obj = flag2(this, "object");
|
|
10179
10592
|
this.assert(
|
|
10180
|
-
obj != void 0 && obj[Symbol.iterator],
|
|
10593
|
+
obj != void 0 && typeof obj[Symbol.iterator] === "function",
|
|
10181
10594
|
"expected #{this} to be an iterable",
|
|
10182
10595
|
"expected #{this} to not be an iterable",
|
|
10183
10596
|
obj
|
|
@@ -10190,10 +10603,12 @@ function oneOf(list, msg) {
|
|
|
10190
10603
|
if (contains) {
|
|
10191
10604
|
this.assert(
|
|
10192
10605
|
list.some(function(possibility) {
|
|
10193
|
-
return expected.indexOf(possibility) > -1
|
|
10606
|
+
return expected.indexOf(possibility) > -1 || isDeep && Array.isArray(expected) && expected.some(function(item) {
|
|
10607
|
+
return eql(item, possibility);
|
|
10608
|
+
});
|
|
10194
10609
|
}),
|
|
10195
|
-
"expected #{this} to contain one of #{exp}",
|
|
10196
|
-
"expected #{this} to not contain one of #{exp}",
|
|
10610
|
+
"expected #{this} to " + (isDeep ? "deeply " : "") + "contain one of #{exp}",
|
|
10611
|
+
"expected #{this} to not " + (isDeep ? "deeply " : "") + "contain one of #{exp}",
|
|
10197
10612
|
list,
|
|
10198
10613
|
expected
|
|
10199
10614
|
);
|
|
@@ -10204,7 +10619,7 @@ function oneOf(list, msg) {
|
|
|
10204
10619
|
return eql(expected, possibility);
|
|
10205
10620
|
}),
|
|
10206
10621
|
"expected #{this} to deeply equal one of #{exp}",
|
|
10207
|
-
"expected #{this} to deeply equal one of #{exp}",
|
|
10622
|
+
"expected #{this} to not deeply equal one of #{exp}",
|
|
10208
10623
|
list,
|
|
10209
10624
|
expected
|
|
10210
10625
|
);
|
|
@@ -10223,18 +10638,31 @@ __name(oneOf, "oneOf");
|
|
|
10223
10638
|
Assertion.addMethod("oneOf", oneOf);
|
|
10224
10639
|
function assertChanges(subject, prop, msg) {
|
|
10225
10640
|
if (msg) flag2(this, "message", msg);
|
|
10226
|
-
|
|
10641
|
+
const fn2 = (
|
|
10642
|
+
/** @type {() => void} */
|
|
10643
|
+
flag2(this, "object")
|
|
10644
|
+
);
|
|
10645
|
+
const flagMsg = flag2(this, "message");
|
|
10646
|
+
const ssfi = flag2(this, "ssfi");
|
|
10227
10647
|
new Assertion(fn2, flagMsg, ssfi, true).is.a("function");
|
|
10228
10648
|
let initial;
|
|
10229
|
-
if (
|
|
10649
|
+
if (prop === null || prop === void 0) {
|
|
10230
10650
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
10231
|
-
initial =
|
|
10651
|
+
initial = /** @type {() => unknown} */
|
|
10652
|
+
subject();
|
|
10232
10653
|
} else {
|
|
10233
10654
|
new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
|
10234
|
-
initial =
|
|
10655
|
+
initial = /** @type {Record<PropertyKey, unknown>} */
|
|
10656
|
+
subject[prop];
|
|
10235
10657
|
}
|
|
10236
10658
|
fn2();
|
|
10237
|
-
let final = prop === void 0 || prop === null ?
|
|
10659
|
+
let final = prop === void 0 || prop === null ? (
|
|
10660
|
+
/** @type {() => unknown} */
|
|
10661
|
+
subject()
|
|
10662
|
+
) : (
|
|
10663
|
+
/** @type {Record<PropertyKey, unknown>} */
|
|
10664
|
+
subject[prop]
|
|
10665
|
+
);
|
|
10238
10666
|
let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
10239
10667
|
flag2(this, "deltaMsgObj", msgObj);
|
|
10240
10668
|
flag2(this, "initialDeltaValue", initial);
|
|
@@ -10252,19 +10680,32 @@ Assertion.addMethod("change", assertChanges);
|
|
|
10252
10680
|
Assertion.addMethod("changes", assertChanges);
|
|
10253
10681
|
function assertIncreases(subject, prop, msg) {
|
|
10254
10682
|
if (msg) flag2(this, "message", msg);
|
|
10255
|
-
|
|
10683
|
+
const fn2 = (
|
|
10684
|
+
/** @type {() => void} */
|
|
10685
|
+
flag2(this, "object")
|
|
10686
|
+
);
|
|
10687
|
+
const flagMsg = flag2(this, "message");
|
|
10688
|
+
const ssfi = flag2(this, "ssfi");
|
|
10256
10689
|
new Assertion(fn2, flagMsg, ssfi, true).is.a("function");
|
|
10257
10690
|
let initial;
|
|
10258
|
-
if (
|
|
10691
|
+
if (prop === null || prop === void 0) {
|
|
10259
10692
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
10260
|
-
initial =
|
|
10693
|
+
initial = /** @type {() => number} */
|
|
10694
|
+
subject();
|
|
10261
10695
|
} else {
|
|
10262
10696
|
new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
|
10263
|
-
initial =
|
|
10697
|
+
initial = /** @type {Record<PropertyKey, number>} */
|
|
10698
|
+
subject[prop];
|
|
10264
10699
|
}
|
|
10265
10700
|
new Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
10266
10701
|
fn2();
|
|
10267
|
-
let final = prop === void 0 || prop === null ?
|
|
10702
|
+
let final = prop === void 0 || prop === null ? (
|
|
10703
|
+
/** @type {() => number} */
|
|
10704
|
+
subject()
|
|
10705
|
+
) : (
|
|
10706
|
+
/** @type {Record<PropertyKey, number>} */
|
|
10707
|
+
subject[prop]
|
|
10708
|
+
);
|
|
10268
10709
|
let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
10269
10710
|
flag2(this, "deltaMsgObj", msgObj);
|
|
10270
10711
|
flag2(this, "initialDeltaValue", initial);
|
|
@@ -10282,19 +10723,32 @@ Assertion.addMethod("increase", assertIncreases);
|
|
|
10282
10723
|
Assertion.addMethod("increases", assertIncreases);
|
|
10283
10724
|
function assertDecreases(subject, prop, msg) {
|
|
10284
10725
|
if (msg) flag2(this, "message", msg);
|
|
10285
|
-
|
|
10726
|
+
const fn2 = (
|
|
10727
|
+
/** @type {() => void} */
|
|
10728
|
+
flag2(this, "object")
|
|
10729
|
+
);
|
|
10730
|
+
const flagMsg = flag2(this, "message");
|
|
10731
|
+
const ssfi = flag2(this, "ssfi");
|
|
10286
10732
|
new Assertion(fn2, flagMsg, ssfi, true).is.a("function");
|
|
10287
10733
|
let initial;
|
|
10288
|
-
if (
|
|
10734
|
+
if (prop === null || prop === void 0) {
|
|
10289
10735
|
new Assertion(subject, flagMsg, ssfi, true).is.a("function");
|
|
10290
|
-
initial =
|
|
10736
|
+
initial = /** @type {() => number} */
|
|
10737
|
+
subject();
|
|
10291
10738
|
} else {
|
|
10292
10739
|
new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop);
|
|
10293
|
-
initial =
|
|
10740
|
+
initial = /** @type {Record<PropertyKey, number>} */
|
|
10741
|
+
subject[prop];
|
|
10294
10742
|
}
|
|
10295
10743
|
new Assertion(initial, flagMsg, ssfi, true).is.a("number");
|
|
10296
10744
|
fn2();
|
|
10297
|
-
let final = prop === void 0 || prop === null ?
|
|
10745
|
+
let final = prop === void 0 || prop === null ? (
|
|
10746
|
+
/** @type {() => number} */
|
|
10747
|
+
subject()
|
|
10748
|
+
) : (
|
|
10749
|
+
/** @type {Record<PropertyKey, number>} */
|
|
10750
|
+
subject[prop]
|
|
10751
|
+
);
|
|
10298
10752
|
let msgObj = prop === void 0 || prop === null ? initial : "." + prop;
|
|
10299
10753
|
flag2(this, "deltaMsgObj", msgObj);
|
|
10300
10754
|
flag2(this, "initialDeltaValue", initial);
|
|
@@ -10426,13 +10880,14 @@ function expect(val, message) {
|
|
|
10426
10880
|
}
|
|
10427
10881
|
__name(expect, "expect");
|
|
10428
10882
|
expect.fail = function(actual, expected, message, operator) {
|
|
10883
|
+
let msg = message;
|
|
10429
10884
|
if (arguments.length < 2) {
|
|
10430
|
-
|
|
10885
|
+
msg = /** @type {string | undefined} */
|
|
10886
|
+
actual;
|
|
10431
10887
|
actual = void 0;
|
|
10432
10888
|
}
|
|
10433
|
-
message = message || "expect.fail()";
|
|
10434
10889
|
throw new AssertionError(
|
|
10435
|
-
|
|
10890
|
+
msg || "expect.fail()",
|
|
10436
10891
|
{
|
|
10437
10892
|
actual,
|
|
10438
10893
|
expected,
|
|
@@ -11098,7 +11553,7 @@ assert3.oneOf = function(inList, list, msg) {
|
|
|
11098
11553
|
new Assertion(inList, msg, assert3.oneOf, true).to.be.oneOf(list);
|
|
11099
11554
|
};
|
|
11100
11555
|
assert3.isIterable = function(obj, msg) {
|
|
11101
|
-
if (obj == void 0 ||
|
|
11556
|
+
if (obj == void 0 || typeof obj[Symbol.iterator] !== "function") {
|
|
11102
11557
|
msg = msg ? `${msg} expected ${inspect22(obj)} to be an iterable` : `expected ${inspect22(obj)} to be an iterable`;
|
|
11103
11558
|
throw new AssertionError(msg, void 0, assert3.isIterable);
|
|
11104
11559
|
}
|
|
@@ -11306,7 +11761,7 @@ function use(fn2) {
|
|
|
11306
11761
|
}
|
|
11307
11762
|
__name(use, "use");
|
|
11308
11763
|
|
|
11309
|
-
// node_modules/vitest/dist/chunks/plugins.
|
|
11764
|
+
// ../../node_modules/vitest/dist/chunks/plugins.DPQHVT0p.js
|
|
11310
11765
|
var serialize2 = (val, config2, indentation, depth, refs, printer2) => {
|
|
11311
11766
|
const name = val.getMockName();
|
|
11312
11767
|
const nameString = name === "vi.fn()" ? "" : ` ${name}`;
|
|
@@ -11339,7 +11794,7 @@ function getSerializers() {
|
|
|
11339
11794
|
return PLUGINS3;
|
|
11340
11795
|
}
|
|
11341
11796
|
|
|
11342
|
-
// node_modules/vitest/dist/chunks/offset.Dy-5Fdfn.js
|
|
11797
|
+
// ../../node_modules/vitest/dist/chunks/offset.Dy-5Fdfn.js
|
|
11343
11798
|
var lineSplitRE = /\r?\n/;
|
|
11344
11799
|
function positionToOffset(source, lineNumber, columnNumber) {
|
|
11345
11800
|
const lines = source.split(lineSplitRE);
|
|
@@ -11373,13 +11828,13 @@ var chars2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
|
11373
11828
|
var intToChar2 = /* @__PURE__ */ new Uint8Array(64);
|
|
11374
11829
|
var charToInt2 = /* @__PURE__ */ new Uint8Array(128);
|
|
11375
11830
|
for (let i3 = 0; i3 < chars2.length; i3++) {
|
|
11376
|
-
let
|
|
11377
|
-
intToChar2[i3] =
|
|
11831
|
+
let c2 = chars2.charCodeAt(i3);
|
|
11832
|
+
intToChar2[i3] = c2, charToInt2[c2] = i3;
|
|
11378
11833
|
}
|
|
11379
11834
|
var textDecoder = new TextDecoder();
|
|
11380
11835
|
var decodeBase64 = (() => {
|
|
11381
11836
|
let capturedBuffer = typeof Buffer == "function" ? Buffer : void 0;
|
|
11382
|
-
return capturedBuffer && typeof capturedBuffer.from == "function" ? (base64) => capturedBuffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (
|
|
11837
|
+
return capturedBuffer && typeof capturedBuffer.from == "function" ? (base64) => capturedBuffer.from(base64, "base64").toString("utf-8") : (base64) => textDecoder.decode(Uint8Array.from(atob(base64), (c2) => c2.charCodeAt(0)));
|
|
11383
11838
|
})();
|
|
11384
11839
|
var MODULE_RUNNER_SOURCEMAPPING_REGEXP = RegExp(`//# ${SOURCEMAPPING_URL}=data:application/json;base64,(.+)`);
|
|
11385
11840
|
var customizationHookNamespace = "vite-module-runner:import-meta-resolve/v1/";
|
|
@@ -11396,8 +11851,8 @@ export async function resolve(specifier, context, nextResolve) {
|
|
|
11396
11851
|
}
|
|
11397
11852
|
|
|
11398
11853
|
`;
|
|
11399
|
-
var envProxy = new Proxy({}, { get(
|
|
11400
|
-
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(
|
|
11854
|
+
var envProxy = new Proxy({}, { get(_2, p2) {
|
|
11855
|
+
throw Error(`[module runner] Dynamic access of "import.meta.env" is not supported. Please, use "import.meta.env.${String(p2)}" instead.`);
|
|
11401
11856
|
} });
|
|
11402
11857
|
var retrieveFileHandlers = /* @__PURE__ */ new Set();
|
|
11403
11858
|
var retrieveSourceMapHandlers = /* @__PURE__ */ new Set();
|
|
@@ -11412,55 +11867,46 @@ var retrieveFileFromHandlers = createExecHandlers(retrieveFileHandlers);
|
|
|
11412
11867
|
var retrieveSourceMapFromHandlers = createExecHandlers(retrieveSourceMapHandlers);
|
|
11413
11868
|
var originalPrepare = Error.prepareStackTrace;
|
|
11414
11869
|
|
|
11415
|
-
// node_modules/tinybench/dist/index.js
|
|
11416
|
-
var
|
|
11870
|
+
// ../../node_modules/tinybench/dist/index.js
|
|
11871
|
+
var e = Object.freeze(() => {
|
|
11417
11872
|
});
|
|
11418
|
-
var
|
|
11419
|
-
var
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11423
|
-
|
|
11424
|
-
|
|
11425
|
-
|
|
11426
|
-
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11433
|
-
|
|
11434
|
-
|
|
11435
|
-
}
|
|
11436
|
-
}, _e = new WeakMap(), _t = new WeakMap(), _n = new WeakMap(), _a);
|
|
11437
|
-
function r(e = globalThis) {
|
|
11438
|
-
let t2 = "unknown", n3 = "unknown";
|
|
11439
|
-
return e.Bun || e.process && e.process.versions?.bun ? (t2 = "bun", n3 = e.Bun.version || "unknown") : e.Deno ? (t2 = "deno", n3 = e.Deno.version?.deno ?? "unknown") : e.process && e.process.release?.name === "node" ? (t2 = "node", n3 = e.process.versions?.node ?? "unknown") : e.HermesInternal ? (t2 = "hermes", n3 = e.HermesInternal.getRuntimeProperties?.()["OSS Release Version"] ?? "unknown") : i2(e) && e.navigator.userAgent === "Cloudflare-Workers" ? t2 = "workerd" : i2(e) && e.navigator.userAgent.toLowerCase().startsWith("quickjs-ng") ? (t2 = "quickjs-ng", n3 = e.navigator.userAgent.split("/")[1] ?? "unknown") : typeof e.Netlify == "object" ? t2 = "netlify" : typeof e.EdgeRuntime == "string" ? t2 = "edge-light" : e.__lagon__ ? t2 = "lagon" : e.fastly ? t2 = "fastly" : e.$262 && e.lockdown && e.AsyncDisposableStack ? t2 = "moddable" : e.d8 ? (t2 = "v8", n3 = typeof e.version == "function" ? e.version() : "unknown") : e.inIon && e.performance && e.performance.mozMemory ? t2 = "spidermonkey" : typeof e.$ == "object" && e.$ !== null && "IsHTMLDDA" in e.$ ? t2 = "jsc" : e.window && e.navigator && (t2 = "browser"), {
|
|
11440
|
-
runtime: t2,
|
|
11441
|
-
version: n3
|
|
11873
|
+
var t2 = globalThis.Event;
|
|
11874
|
+
var i2 = (async () => {
|
|
11875
|
+
}).constructor;
|
|
11876
|
+
function p(e2 = globalThis) {
|
|
11877
|
+
let t3 = "unknown", n2 = "unknown";
|
|
11878
|
+
if (e2.Bun || e2.process && e2.process.versions?.bun) {
|
|
11879
|
+
t3 = "bun";
|
|
11880
|
+
let r = e2.Bun?.version;
|
|
11881
|
+
if (r) n2 = r;
|
|
11882
|
+
else {
|
|
11883
|
+
let t4 = e2.process?.versions?.bun;
|
|
11884
|
+
t4 && (n2 = t4);
|
|
11885
|
+
}
|
|
11886
|
+
} else e2.Deno ? (t3 = "deno", n2 = e2.Deno.version?.deno ?? "unknown") : e2.process && e2.process.release?.name === "node" ? (t3 = "node", n2 = e2.process.versions?.node ?? "unknown") : e2.HermesInternal ? (t3 = "hermes", n2 = e2.HermesInternal.getRuntimeProperties?.()["OSS Release Version"] ?? "unknown") : m(e2) && e2.navigator.userAgent === "Cloudflare-Workers" ? t3 = "workerd" : m(e2) && e2.navigator.userAgent.toLowerCase().startsWith("quickjs-ng") ? (t3 = "quickjs-ng", n2 = e2.navigator.userAgent.split("/")[1] ?? "unknown") : typeof e2.Netlify == "object" ? t3 = "netlify" : typeof e2.EdgeRuntime == "string" ? t3 = "edge-light" : e2.__lagon__ ? t3 = "lagon" : e2.fastly ? t3 = "fastly" : e2.$262 && e2.lockdown && e2.AsyncDisposableStack ? t3 = "moddable" : e2.d8 ? (t3 = "v8", n2 = typeof e2.version == "function" ? e2.version() : "unknown") : e2.inIon && e2.performance && e2.performance.mozMemory ? t3 = "spidermonkey" : typeof e2.$ == "object" && e2.$ !== null && "IsHTMLDDA" in e2.$ ? t3 = "jsc" : e2.window && e2.navigator && (t3 = "browser");
|
|
11887
|
+
return {
|
|
11888
|
+
runtime: t3,
|
|
11889
|
+
version: n2
|
|
11442
11890
|
};
|
|
11443
11891
|
}
|
|
11444
|
-
function
|
|
11445
|
-
return typeof
|
|
11892
|
+
function m(e2 = globalThis) {
|
|
11893
|
+
return typeof e2.navigator == "object" && e2.navigator !== null && typeof e2.navigator.userAgent == "string";
|
|
11446
11894
|
}
|
|
11447
|
-
var { runtime:
|
|
11448
|
-
var
|
|
11449
|
-
|
|
11450
|
-
var P = globalThis.performance.now.bind(globalThis.performance);
|
|
11451
|
-
var I = globalThis.process?.hrtime?.bigint.bind(globalThis.process?.hrtime) ?? (() => {
|
|
11895
|
+
var { runtime: h2, version: g } = p();
|
|
11896
|
+
var _ = globalThis.performance.now.bind(globalThis.performance);
|
|
11897
|
+
var y2 = globalThis.process?.hrtime?.bigint.bind(globalThis.process?.hrtime) ?? (() => {
|
|
11452
11898
|
throw Error("hrtime.bigint() is not supported in this JS environment");
|
|
11453
11899
|
});
|
|
11454
|
-
var
|
|
11900
|
+
var S = globalThis.Bun?.nanoseconds;
|
|
11455
11901
|
|
|
11456
|
-
// node_modules/vitest/dist/chunks/index.
|
|
11902
|
+
// ../../node_modules/vitest/dist/chunks/index.aTZaPVhf.js
|
|
11457
11903
|
var import_expect_type = __toESM(require_dist(), 1);
|
|
11458
11904
|
var naturalCompare$1 = { exports: {} };
|
|
11459
11905
|
var hasRequiredNaturalCompare;
|
|
11460
11906
|
function requireNaturalCompare() {
|
|
11461
11907
|
if (hasRequiredNaturalCompare) return naturalCompare$1.exports;
|
|
11462
11908
|
hasRequiredNaturalCompare = 1;
|
|
11463
|
-
var naturalCompare2 = function(
|
|
11909
|
+
var naturalCompare2 = function(a, b2) {
|
|
11464
11910
|
var i3, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
|
|
11465
11911
|
function getCode(str, pos, code) {
|
|
11466
11912
|
if (code) {
|
|
@@ -11470,11 +11916,11 @@ function requireNaturalCompare() {
|
|
|
11470
11916
|
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
11471
11917
|
return code > -1 ? code + 76 : (code = str.charCodeAt(pos) || 0, code < 45 || code > 127) ? code : code < 46 ? 65 : code < 48 ? code - 1 : code < 58 ? code + 18 : code < 65 ? code - 11 : code < 91 ? code + 11 : code < 97 ? code - 37 : code < 123 ? code + 5 : code - 63;
|
|
11472
11918
|
}
|
|
11473
|
-
if ((
|
|
11474
|
-
codeA = getCode(
|
|
11919
|
+
if ((a += "") != (b2 += "")) for (; codeB; ) {
|
|
11920
|
+
codeA = getCode(a, posA++);
|
|
11475
11921
|
codeB = getCode(b2, posB++);
|
|
11476
11922
|
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
11477
|
-
codeA = getCode(
|
|
11923
|
+
codeA = getCode(a, posA, posA);
|
|
11478
11924
|
codeB = getCode(b2, posB, posA = i3);
|
|
11479
11925
|
posB = i3;
|
|
11480
11926
|
}
|
|
@@ -11484,13 +11930,13 @@ function requireNaturalCompare() {
|
|
|
11484
11930
|
};
|
|
11485
11931
|
try {
|
|
11486
11932
|
naturalCompare$1.exports = naturalCompare2;
|
|
11487
|
-
} catch (
|
|
11933
|
+
} catch (e2) {
|
|
11488
11934
|
String.naturalCompare = naturalCompare2;
|
|
11489
11935
|
}
|
|
11490
11936
|
return naturalCompare$1.exports;
|
|
11491
11937
|
}
|
|
11492
11938
|
var naturalCompareExports = requireNaturalCompare();
|
|
11493
|
-
var naturalCompare = /* @__PURE__ */
|
|
11939
|
+
var naturalCompare = /* @__PURE__ */ getDefaultExportFromCjs(naturalCompareExports);
|
|
11494
11940
|
function testNameToKey(testName2, count) {
|
|
11495
11941
|
return `${testName2} ${count}`;
|
|
11496
11942
|
}
|
|
@@ -11527,7 +11973,7 @@ function serialize3(val, indent = 2, formatOverrides = {}) {
|
|
|
11527
11973
|
}));
|
|
11528
11974
|
}
|
|
11529
11975
|
function escapeBacktickString(str) {
|
|
11530
|
-
return str.replace(/`|\\|\$\{/g, "\\$&");
|
|
11976
|
+
return str.replace(/`|\\|\$\{/g, "\\$&").replace(/\r/g, "\\r");
|
|
11531
11977
|
}
|
|
11532
11978
|
function printBacktickString(str) {
|
|
11533
11979
|
return `\`${escapeBacktickString(str)}\``;
|
|
@@ -11547,12 +11993,12 @@ ${snapshots.join("\n\n")}
|
|
|
11547
11993
|
}
|
|
11548
11994
|
function deepMergeArray(target = [], source = []) {
|
|
11549
11995
|
const mergedOutput = Array.from(target);
|
|
11550
|
-
source.forEach((sourceElement,
|
|
11551
|
-
const targetElement = mergedOutput[
|
|
11552
|
-
if (Array.isArray(target[
|
|
11553
|
-
else if (isObject(targetElement)) mergedOutput[
|
|
11996
|
+
source.forEach((sourceElement, index2) => {
|
|
11997
|
+
const targetElement = mergedOutput[index2];
|
|
11998
|
+
if (Array.isArray(target[index2])) mergedOutput[index2] = deepMergeArray(target[index2], sourceElement);
|
|
11999
|
+
else if (isObject(targetElement)) mergedOutput[index2] = deepMergeSnapshot(target[index2], sourceElement);
|
|
11554
12000
|
else
|
|
11555
|
-
mergedOutput[
|
|
12001
|
+
mergedOutput[index2] = sourceElement;
|
|
11556
12002
|
});
|
|
11557
12003
|
return mergedOutput;
|
|
11558
12004
|
}
|
|
@@ -11560,9 +12006,10 @@ function deepMergeSnapshot(target, source) {
|
|
|
11560
12006
|
if (isObject(target) && isObject(source)) {
|
|
11561
12007
|
const mergedOutput = { ...target };
|
|
11562
12008
|
Object.keys(source).forEach((key) => {
|
|
11563
|
-
if (isObject(source[key]) && !source[key].$$typeof)
|
|
11564
|
-
|
|
11565
|
-
|
|
12009
|
+
if (isObject(source[key]) && !source[key].$$typeof) {
|
|
12010
|
+
if (!(key in target)) Object.assign(mergedOutput, { [key]: source[key] });
|
|
12011
|
+
else mergedOutput[key] = deepMergeSnapshot(target[key], source[key]);
|
|
12012
|
+
} else if (Array.isArray(source[key])) mergedOutput[key] = deepMergeArray(target[key], source[key]);
|
|
11566
12013
|
else Object.assign(mergedOutput, { [key]: source[key] });
|
|
11567
12014
|
});
|
|
11568
12015
|
return mergedOutput;
|
|
@@ -11633,34 +12080,34 @@ var buildStartObjectRegex = /* @__PURE__ */ memo((assertionName) => {
|
|
|
11633
12080
|
const replaced = defaultStartObjectRegex.source.replace("toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot", escapeRegExp(assertionName));
|
|
11634
12081
|
return new RegExp(replaced);
|
|
11635
12082
|
});
|
|
11636
|
-
function replaceObjectSnap(code, s,
|
|
11637
|
-
let _code = code.slice(
|
|
12083
|
+
function replaceObjectSnap(code, s, index2, newSnap, assertionName) {
|
|
12084
|
+
let _code = code.slice(index2);
|
|
11638
12085
|
const startMatch = (assertionName ? buildStartObjectRegex(assertionName) : defaultStartObjectRegex).exec(_code);
|
|
11639
12086
|
if (!startMatch) return false;
|
|
11640
12087
|
_code = _code.slice(startMatch.index);
|
|
11641
12088
|
let callEnd = getCallLastIndex(_code);
|
|
11642
12089
|
if (callEnd === null) return false;
|
|
11643
|
-
callEnd +=
|
|
11644
|
-
const shapeEnd = getObjectShapeEndIndex(code,
|
|
11645
|
-
const snap = `, ${prepareSnapString(newSnap, code,
|
|
12090
|
+
callEnd += index2 + startMatch.index;
|
|
12091
|
+
const shapeEnd = getObjectShapeEndIndex(code, index2 + startMatch.index + startMatch[0].length);
|
|
12092
|
+
const snap = `, ${prepareSnapString(newSnap, code, index2)}`;
|
|
11646
12093
|
if (shapeEnd === callEnd)
|
|
11647
12094
|
s.appendLeft(callEnd, snap);
|
|
11648
12095
|
else
|
|
11649
12096
|
s.overwrite(shapeEnd, callEnd, snap);
|
|
11650
12097
|
return true;
|
|
11651
12098
|
}
|
|
11652
|
-
function getObjectShapeEndIndex(code,
|
|
12099
|
+
function getObjectShapeEndIndex(code, index2) {
|
|
11653
12100
|
let startBraces = 1;
|
|
11654
12101
|
let endBraces = 0;
|
|
11655
|
-
while (startBraces !== endBraces &&
|
|
11656
|
-
const s = code[
|
|
12102
|
+
while (startBraces !== endBraces && index2 < code.length) {
|
|
12103
|
+
const s = code[index2++];
|
|
11657
12104
|
if (s === "{") startBraces++;
|
|
11658
12105
|
else if (s === "}") endBraces++;
|
|
11659
12106
|
}
|
|
11660
|
-
return
|
|
12107
|
+
return index2;
|
|
11661
12108
|
}
|
|
11662
|
-
function prepareSnapString(snap, source,
|
|
11663
|
-
const lineNumber = offsetToLineNumber(source,
|
|
12109
|
+
function prepareSnapString(snap, source, index2) {
|
|
12110
|
+
const lineNumber = offsetToLineNumber(source, index2);
|
|
11664
12111
|
const indent = source.split(lineSplitRE)[lineNumber - 1].match(/^\s*/)[0] || "";
|
|
11665
12112
|
const indentNext = indent.includes(" ") ? `${indent} ` : `${indent} `;
|
|
11666
12113
|
const lines = snap.trim().replace(/\\/g, "\\\\").split(/\n/g);
|
|
@@ -11672,17 +12119,17 @@ ${lines.map((i3) => i3 ? indentNext + i3 : "").join("\n").replace(/`/g, "\\`").r
|
|
|
11672
12119
|
${indent}${quote}`;
|
|
11673
12120
|
}
|
|
11674
12121
|
var defaultMethodNames = ["toMatchInlineSnapshot", "toThrowErrorMatchingInlineSnapshot"];
|
|
11675
|
-
function getCodeStartingAtIndex(code,
|
|
12122
|
+
function getCodeStartingAtIndex(code, index2, methodNames) {
|
|
11676
12123
|
for (const name of methodNames) {
|
|
11677
|
-
const adjusted =
|
|
11678
|
-
if (adjusted >= 0 && code.slice(adjusted,
|
|
12124
|
+
const adjusted = index2 - name.length;
|
|
12125
|
+
if (adjusted >= 0 && code.slice(adjusted, index2) === name) return {
|
|
11679
12126
|
code: code.slice(adjusted),
|
|
11680
12127
|
index: adjusted
|
|
11681
12128
|
};
|
|
11682
12129
|
}
|
|
11683
12130
|
return {
|
|
11684
|
-
code: code.slice(
|
|
11685
|
-
index
|
|
12131
|
+
code: code.slice(index2),
|
|
12132
|
+
index: index2
|
|
11686
12133
|
};
|
|
11687
12134
|
}
|
|
11688
12135
|
var defaultStartRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/;
|
|
@@ -11691,13 +12138,13 @@ var buildStartRegex = /* @__PURE__ */ memo((assertionName) => {
|
|
|
11691
12138
|
return new RegExp(replaced);
|
|
11692
12139
|
});
|
|
11693
12140
|
function replaceInlineSnap(code, s, currentIndex, newSnap, assertionName) {
|
|
11694
|
-
const { code: codeStartingAtIndex, index } = getCodeStartingAtIndex(code, currentIndex, assertionName ? [assertionName] : defaultMethodNames);
|
|
12141
|
+
const { code: codeStartingAtIndex, index: index2 } = getCodeStartingAtIndex(code, currentIndex, assertionName ? [assertionName] : defaultMethodNames);
|
|
11695
12142
|
const startMatch = (assertionName ? buildStartRegex(assertionName) : defaultStartRegex).exec(codeStartingAtIndex);
|
|
11696
12143
|
const firstKeywordMatch = (assertionName ? new RegExp(escapeRegExp(assertionName)) : /toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/).exec(codeStartingAtIndex);
|
|
11697
|
-
if (!startMatch || startMatch.index !== firstKeywordMatch?.index) return replaceObjectSnap(code, s,
|
|
12144
|
+
if (!startMatch || startMatch.index !== firstKeywordMatch?.index) return replaceObjectSnap(code, s, index2, newSnap, assertionName);
|
|
11698
12145
|
const quote = startMatch[1];
|
|
11699
|
-
const startIndex =
|
|
11700
|
-
const snapString = prepareSnapString(newSnap, code,
|
|
12146
|
+
const startIndex = index2 + startMatch.index + startMatch[0].length;
|
|
12147
|
+
const snapString = prepareSnapString(newSnap, code, index2);
|
|
11701
12148
|
if (quote === ")") {
|
|
11702
12149
|
s.appendRight(startIndex - 1, snapString);
|
|
11703
12150
|
return true;
|
|
@@ -11733,8 +12180,8 @@ async function saveRawSnapshots(environment, snapshots) {
|
|
|
11733
12180
|
if (!snap.readonly) await environment.saveSnapshotFile(snap.file, snap.snapshot);
|
|
11734
12181
|
}));
|
|
11735
12182
|
}
|
|
11736
|
-
function isSameStackPosition(x,
|
|
11737
|
-
return x.file ===
|
|
12183
|
+
function isSameStackPosition(x, y3) {
|
|
12184
|
+
return x.file === y3.file && x.column === y3.column && x.line === y3.line;
|
|
11738
12185
|
}
|
|
11739
12186
|
var SnapshotState = class _SnapshotState {
|
|
11740
12187
|
constructor(testFilePath, snapshotPath, fileData, options) {
|
|
@@ -11749,6 +12196,7 @@ var SnapshotState = class _SnapshotState {
|
|
|
11749
12196
|
__publicField(this, "_inlineSnapshotStacks");
|
|
11750
12197
|
__publicField(this, "_testIdToKeys", new DefaultMap(() => []));
|
|
11751
12198
|
__publicField(this, "_rawSnapshots");
|
|
12199
|
+
__publicField(this, "_rawSnapshotFiles", /* @__PURE__ */ new Set());
|
|
11752
12200
|
__publicField(this, "_uncheckedKeys");
|
|
11753
12201
|
__publicField(this, "_snapshotFormat");
|
|
11754
12202
|
__publicField(this, "_environment");
|
|
@@ -11916,17 +12364,18 @@ ${message}`);
|
|
|
11916
12364
|
}
|
|
11917
12365
|
_reconcile(opts) {
|
|
11918
12366
|
if (opts.hasSnapshot && this._updateSnapshot === "all" || (!opts.hasSnapshot || !opts.snapshotIsPersisted) && (this._updateSnapshot === "new" || this._updateSnapshot === "all")) {
|
|
11919
|
-
if (this._updateSnapshot === "all")
|
|
11920
|
-
if (opts.
|
|
11921
|
-
|
|
11922
|
-
|
|
11923
|
-
|
|
11924
|
-
|
|
11925
|
-
|
|
11926
|
-
|
|
11927
|
-
|
|
11928
|
-
|
|
11929
|
-
|
|
12367
|
+
if (this._updateSnapshot === "all") {
|
|
12368
|
+
if (!opts.pass) {
|
|
12369
|
+
if (opts.hasSnapshot) this.updated.increment(opts.testId);
|
|
12370
|
+
else this.added.increment(opts.testId);
|
|
12371
|
+
this._addSnapshot(opts.key, opts.addValue, {
|
|
12372
|
+
stack: opts.stack,
|
|
12373
|
+
testId: opts.testId,
|
|
12374
|
+
rawSnapshot: opts.rawSnapshot,
|
|
12375
|
+
assertionName: opts.assertionName
|
|
12376
|
+
});
|
|
12377
|
+
} else this.matched.increment(opts.testId);
|
|
12378
|
+
} else {
|
|
11930
12379
|
this._addSnapshot(opts.key, opts.addValue, {
|
|
11931
12380
|
stack: opts.stack,
|
|
11932
12381
|
testId: opts.testId,
|
|
@@ -12023,6 +12472,7 @@ ${message}`);
|
|
|
12023
12472
|
let receivedSerialized = rawSnapshot && typeof received === "string" ? received : serialize3(received, void 0, this._snapshotFormat);
|
|
12024
12473
|
if (!rawSnapshot) receivedSerialized = addExtraLineBreaks(receivedSerialized);
|
|
12025
12474
|
if (rawSnapshot) {
|
|
12475
|
+
this._rawSnapshotFiles.add(rawSnapshot.file);
|
|
12026
12476
|
if (rawSnapshot.content && /\r\n/.test(rawSnapshot.content) && !/\r\n/.test(receivedSerialized)) rawSnapshot.content = normalizeNewlines(rawSnapshot.content);
|
|
12027
12477
|
}
|
|
12028
12478
|
const expected = isInline ? inlineSnapshot : rawSnapshot ? rawSnapshot.content : this._snapshotData[key];
|
|
@@ -12076,6 +12526,14 @@ ${message}`);
|
|
|
12076
12526
|
assertionName
|
|
12077
12527
|
});
|
|
12078
12528
|
}
|
|
12529
|
+
/**
|
|
12530
|
+
* The snapshot file, if the test file stores snapshots in it, and every asserted file snapshot.
|
|
12531
|
+
*/
|
|
12532
|
+
getSnapshotFiles() {
|
|
12533
|
+
const files = Array.from(this._rawSnapshotFiles);
|
|
12534
|
+
if (this._fileExists || Object.keys(this._snapshotData).length) files.unshift(this.snapshotPath);
|
|
12535
|
+
return files;
|
|
12536
|
+
}
|
|
12079
12537
|
async pack() {
|
|
12080
12538
|
const snapshot = {
|
|
12081
12539
|
filepath: this.testFilePath,
|
|
@@ -12253,9 +12711,9 @@ var SnapshotClient = class {
|
|
|
12253
12711
|
adapter,
|
|
12254
12712
|
poll: () => poll({ signal: timeoutController.signal }),
|
|
12255
12713
|
interval,
|
|
12256
|
-
timedOut: timeout > 0 ? new Promise((
|
|
12714
|
+
timedOut: timeout > 0 ? new Promise((r) => setTimeout(() => {
|
|
12257
12715
|
timeoutController.abort();
|
|
12258
|
-
|
|
12716
|
+
r();
|
|
12259
12717
|
}, timeout)) : void 0,
|
|
12260
12718
|
match: reference ? (captured) => adapter.match(captured, reference).pass : void 0
|
|
12261
12719
|
});
|
|
@@ -12325,7 +12783,7 @@ async function getStableSnapshot({ adapter, poll, interval, timedOut, match }) {
|
|
|
12325
12783
|
lastStable = void 0;
|
|
12326
12784
|
lastPollError = pollError;
|
|
12327
12785
|
}
|
|
12328
|
-
if (!(await raceWith$1(new Promise((
|
|
12786
|
+
if (!(await raceWith$1(new Promise((r) => setTimeout(r, interval)), timedOut)).ok) break;
|
|
12329
12787
|
}
|
|
12330
12788
|
return {
|
|
12331
12789
|
...lastStable,
|
|
@@ -12374,7 +12832,7 @@ var ChaiStyleAssertions = (chai, utils) => {
|
|
|
12374
12832
|
defMethod("calledOnceWith", "toHaveBeenCalledExactlyOnceWith");
|
|
12375
12833
|
defMethod("lastCalledWith", "toHaveBeenLastCalledWith");
|
|
12376
12834
|
defMethod("nthCalledWith", "toHaveBeenNthCalledWith");
|
|
12377
|
-
defMethod("returned", "
|
|
12835
|
+
defMethod("returned", "toHaveReturnedWith");
|
|
12378
12836
|
defMethod("returnedWith", "toHaveReturnedWith");
|
|
12379
12837
|
defMethod("returnedTimes", "toHaveReturnedTimes");
|
|
12380
12838
|
defMethod("lastReturnedWith", "toHaveLastReturnedWith");
|
|
@@ -12408,10 +12866,11 @@ ${printReceived3(actual)}`
|
|
|
12408
12866
|
},
|
|
12409
12867
|
toBeOneOf(actual, expected) {
|
|
12410
12868
|
const { equals: equals2, customTesters } = this;
|
|
12411
|
-
const { printReceived: printReceived3, printExpected: printExpected3, matcherHint: matcherHint2 } = this.utils;
|
|
12869
|
+
const { printReceived: printReceived3, printExpected: printExpected3, matcherHint: matcherHint2, iterableEquality: iterableEquality2 } = this.utils;
|
|
12870
|
+
const testers = [...customTesters, iterableEquality2];
|
|
12412
12871
|
let pass;
|
|
12413
|
-
if (Array.isArray(expected)) pass = expected.length === 0 || expected.some((item) => equals2(item, actual,
|
|
12414
|
-
else if (expected instanceof Set) pass = expected.size === 0 || expected.has(actual) || [...expected].some((item) => equals2(item, actual,
|
|
12872
|
+
if (Array.isArray(expected)) pass = expected.length === 0 || expected.some((item) => equals2(item, actual, testers));
|
|
12873
|
+
else if (expected instanceof Set) pass = expected.size === 0 || expected.has(actual) || [...expected].some((item) => equals2(item, actual, testers));
|
|
12415
12874
|
else throw new TypeError(`You must provide an array or set to ${matcherHint2(".toBeOneOf")}, not '${typeof expected}'.`);
|
|
12416
12875
|
return {
|
|
12417
12876
|
pass,
|
|
@@ -12430,11 +12889,11 @@ ${printReceived3(actual)}`
|
|
|
12430
12889
|
};
|
|
12431
12890
|
}
|
|
12432
12891
|
};
|
|
12433
|
-
var EXPECTED_COLOR =
|
|
12434
|
-
var RECEIVED_COLOR =
|
|
12435
|
-
var INVERTED_COLOR =
|
|
12436
|
-
var BOLD_WEIGHT =
|
|
12437
|
-
var DIM_COLOR =
|
|
12892
|
+
var EXPECTED_COLOR = $.green;
|
|
12893
|
+
var RECEIVED_COLOR = $.red;
|
|
12894
|
+
var INVERTED_COLOR = $.inverse;
|
|
12895
|
+
var BOLD_WEIGHT = $.bold;
|
|
12896
|
+
var DIM_COLOR = $.dim;
|
|
12438
12897
|
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
|
|
12439
12898
|
const { comment = "", isDirectExpectCall = false, isNot = false, promise = "", secondArgument = "", expectedColor = EXPECTED_COLOR, receivedColor = RECEIVED_COLOR, secondArgumentColor = EXPECTED_COLOR } = options;
|
|
12440
12899
|
let hint = "";
|
|
@@ -12504,20 +12963,20 @@ function addCustomEqualityTesters(newTesters) {
|
|
|
12504
12963
|
function getCustomEqualityTesters() {
|
|
12505
12964
|
return globalThis[JEST_MATCHERS_OBJECT].customEqualityTesters;
|
|
12506
12965
|
}
|
|
12507
|
-
function equals(
|
|
12966
|
+
function equals(a, b2, customTesters, strictCheck) {
|
|
12508
12967
|
customTesters = customTesters || [];
|
|
12509
|
-
return eq(
|
|
12968
|
+
return eq(a, b2, [], [], customTesters, strictCheck ? hasKey : hasDefinedKey);
|
|
12510
12969
|
}
|
|
12511
12970
|
function isAsymmetric(obj) {
|
|
12512
12971
|
return !!obj && typeof obj === "object" && "asymmetricMatch" in obj && isA("Function", obj.asymmetricMatch);
|
|
12513
12972
|
}
|
|
12514
|
-
function asymmetricMatch(
|
|
12515
|
-
const asymmetricA = isAsymmetric(
|
|
12973
|
+
function asymmetricMatch(a, b2, customTesters) {
|
|
12974
|
+
const asymmetricA = isAsymmetric(a);
|
|
12516
12975
|
const asymmetricB = isAsymmetric(b2);
|
|
12517
12976
|
if (asymmetricA && asymmetricB) return;
|
|
12518
12977
|
const testers = customTesters.filter((tester) => !isSubsetEqualityTester(tester));
|
|
12519
|
-
if (asymmetricA) return
|
|
12520
|
-
if (asymmetricB) return b2.asymmetricMatch(
|
|
12978
|
+
if (asymmetricA) return a.asymmetricMatch(b2, testers);
|
|
12979
|
+
if (asymmetricB) return b2.asymmetricMatch(a, testers);
|
|
12521
12980
|
}
|
|
12522
12981
|
function isError(value) {
|
|
12523
12982
|
if (typeof Error.isError === "function") return Error.isError(value);
|
|
@@ -12530,38 +12989,38 @@ function isError(value) {
|
|
|
12530
12989
|
return value instanceof Error;
|
|
12531
12990
|
}
|
|
12532
12991
|
}
|
|
12533
|
-
function eq(
|
|
12992
|
+
function eq(a, b2, aStack, bStack, customTesters, hasKey2) {
|
|
12534
12993
|
let result = true;
|
|
12535
|
-
const asymmetricResult = asymmetricMatch(
|
|
12994
|
+
const asymmetricResult = asymmetricMatch(a, b2, customTesters);
|
|
12536
12995
|
if (asymmetricResult !== void 0) return asymmetricResult;
|
|
12537
12996
|
const testerContext = { equals };
|
|
12538
12997
|
for (let i3 = 0; i3 < customTesters.length; i3++) {
|
|
12539
|
-
const customTesterResult = customTesters[i3].call(testerContext,
|
|
12998
|
+
const customTesterResult = customTesters[i3].call(testerContext, a, b2, customTesters);
|
|
12540
12999
|
if (customTesterResult !== void 0) return customTesterResult;
|
|
12541
13000
|
}
|
|
12542
|
-
if (typeof URL === "function" &&
|
|
12543
|
-
if (Object.is(
|
|
12544
|
-
if (
|
|
12545
|
-
const className = Object.prototype.toString.call(
|
|
13001
|
+
if (typeof URL === "function" && a instanceof URL && b2 instanceof URL) return a.href === b2.href;
|
|
13002
|
+
if (Object.is(a, b2)) return true;
|
|
13003
|
+
if (a === null || b2 === null) return a === b2;
|
|
13004
|
+
const className = Object.prototype.toString.call(a);
|
|
12546
13005
|
if (className !== Object.prototype.toString.call(b2)) return false;
|
|
12547
13006
|
switch (className) {
|
|
12548
13007
|
case "[object Boolean]":
|
|
12549
13008
|
case "[object String]":
|
|
12550
13009
|
case "[object Number]":
|
|
12551
|
-
if (typeof
|
|
13010
|
+
if (typeof a !== typeof b2)
|
|
12552
13011
|
return false;
|
|
12553
|
-
else if (typeof
|
|
12554
|
-
return Object.is(
|
|
13012
|
+
else if (typeof a !== "object" && typeof b2 !== "object")
|
|
13013
|
+
return Object.is(a, b2);
|
|
12555
13014
|
else
|
|
12556
|
-
return Object.is(
|
|
13015
|
+
return Object.is(a.valueOf(), b2.valueOf());
|
|
12557
13016
|
case "[object Date]": {
|
|
12558
|
-
const numA = +
|
|
13017
|
+
const numA = +a;
|
|
12559
13018
|
const numB = +b2;
|
|
12560
13019
|
return numA === numB || Number.isNaN(numA) && Number.isNaN(numB);
|
|
12561
13020
|
}
|
|
12562
13021
|
// RegExps are compared by their source patterns and flags.
|
|
12563
13022
|
case "[object RegExp]":
|
|
12564
|
-
return
|
|
13023
|
+
return a.source === b2.source && a.flags === b2.flags;
|
|
12565
13024
|
case "[object Temporal.Instant]":
|
|
12566
13025
|
case "[object Temporal.ZonedDateTime]":
|
|
12567
13026
|
case "[object Temporal.PlainDateTime]":
|
|
@@ -12569,43 +13028,43 @@ function eq(a2, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
12569
13028
|
case "[object Temporal.PlainTime]":
|
|
12570
13029
|
case "[object Temporal.PlainYearMonth]":
|
|
12571
13030
|
case "[object Temporal.PlainMonthDay]":
|
|
12572
|
-
return
|
|
13031
|
+
return a.equals(b2);
|
|
12573
13032
|
case "[object Temporal.Duration]":
|
|
12574
|
-
return
|
|
13033
|
+
return a.toString() === b2.toString();
|
|
12575
13034
|
}
|
|
12576
|
-
if (typeof
|
|
12577
|
-
if (isDomNode(
|
|
13035
|
+
if (typeof a !== "object" || typeof b2 !== "object") return false;
|
|
13036
|
+
if (isDomNode(a) && isDomNode(b2)) return a.isEqualNode(b2);
|
|
12578
13037
|
let length = aStack.length;
|
|
12579
13038
|
while (length--)
|
|
12580
|
-
if (aStack[length] ===
|
|
13039
|
+
if (aStack[length] === a) return bStack[length] === b2;
|
|
12581
13040
|
else if (bStack[length] === b2) return false;
|
|
12582
|
-
aStack.push(
|
|
13041
|
+
aStack.push(a);
|
|
12583
13042
|
bStack.push(b2);
|
|
12584
|
-
if (className === "[object Array]" &&
|
|
12585
|
-
if (isError(
|
|
12586
|
-
return isErrorEqual(
|
|
13043
|
+
if (className === "[object Array]" && a.length !== b2.length) return false;
|
|
13044
|
+
if (isError(a) && isError(b2)) try {
|
|
13045
|
+
return isErrorEqual(a, b2, aStack, bStack, customTesters, hasKey2);
|
|
12587
13046
|
} finally {
|
|
12588
13047
|
aStack.pop();
|
|
12589
13048
|
bStack.pop();
|
|
12590
13049
|
}
|
|
12591
|
-
const aKeys = keys(
|
|
13050
|
+
const aKeys = keys(a, hasKey2);
|
|
12592
13051
|
let key;
|
|
12593
13052
|
let size = aKeys.length;
|
|
12594
13053
|
if (keys(b2, hasKey2).length !== size) return false;
|
|
12595
13054
|
while (size--) {
|
|
12596
13055
|
key = aKeys[size];
|
|
12597
|
-
result = hasKey2(b2, key) && eq(
|
|
13056
|
+
result = hasKey2(b2, key) && eq(a[key], b2[key], aStack, bStack, customTesters, hasKey2);
|
|
12598
13057
|
if (!result) return false;
|
|
12599
13058
|
}
|
|
12600
13059
|
aStack.pop();
|
|
12601
13060
|
bStack.pop();
|
|
12602
13061
|
return result;
|
|
12603
13062
|
}
|
|
12604
|
-
function isErrorEqual(
|
|
12605
|
-
let result = Object.prototype.toString.call(
|
|
12606
|
-
if (typeof b2.cause !== "undefined") result && (result = eq(
|
|
12607
|
-
if (
|
|
12608
|
-
result && (result = eq({ ...
|
|
13063
|
+
function isErrorEqual(a, b2, aStack, bStack, customTesters, hasKey2) {
|
|
13064
|
+
let result = Object.prototype.toString.call(a) === Object.prototype.toString.call(b2) && a.name === b2.name && a.message === b2.message;
|
|
13065
|
+
if (typeof b2.cause !== "undefined") result && (result = eq(a.cause, b2.cause, aStack, bStack, customTesters, hasKey2));
|
|
13066
|
+
if (a instanceof AggregateError && b2 instanceof AggregateError) result && (result = eq(a.errors, b2.errors, aStack, bStack, customTesters, hasKey2));
|
|
13067
|
+
result && (result = eq({ ...a }, { ...b2 }, aStack, bStack, customTesters, hasKey2));
|
|
12609
13068
|
return result;
|
|
12610
13069
|
}
|
|
12611
13070
|
function keys(obj, hasKey2) {
|
|
@@ -12655,23 +13114,23 @@ var IteratorSymbol = Symbol.iterator;
|
|
|
12655
13114
|
function hasIterator(object2) {
|
|
12656
13115
|
return !!(object2 != null && object2[IteratorSymbol]);
|
|
12657
13116
|
}
|
|
12658
|
-
function iterableEquality(
|
|
12659
|
-
if (typeof
|
|
12660
|
-
if (
|
|
13117
|
+
function iterableEquality(a, b2, customTesters = [], aStack = [], bStack = []) {
|
|
13118
|
+
if (typeof a !== "object" || typeof b2 !== "object" || Array.isArray(a) || Array.isArray(b2) || !hasIterator(a) || !hasIterator(b2)) return;
|
|
13119
|
+
if (a.constructor !== b2.constructor) return false;
|
|
12661
13120
|
let length = aStack.length;
|
|
12662
13121
|
while (length--)
|
|
12663
|
-
if (aStack[length] ===
|
|
12664
|
-
aStack.push(
|
|
13122
|
+
if (aStack[length] === a) return bStack[length] === b2;
|
|
13123
|
+
aStack.push(a);
|
|
12665
13124
|
bStack.push(b2);
|
|
12666
|
-
const filteredCustomTesters = [...customTesters.filter((
|
|
12667
|
-
function iterableEqualityWithStack(
|
|
12668
|
-
return iterableEquality(
|
|
13125
|
+
const filteredCustomTesters = [...customTesters.filter((t3) => t3 !== iterableEquality), iterableEqualityWithStack];
|
|
13126
|
+
function iterableEqualityWithStack(a2, b3) {
|
|
13127
|
+
return iterableEquality(a2, b3, [...customTesters], [...aStack], [...bStack]);
|
|
12669
13128
|
}
|
|
12670
|
-
if (
|
|
12671
|
-
if (
|
|
12672
|
-
else if (isA("Set",
|
|
13129
|
+
if (a.size !== void 0) {
|
|
13130
|
+
if (a.size !== b2.size) return false;
|
|
13131
|
+
else if (isA("Set", a) || isImmutableUnorderedSet(a)) {
|
|
12673
13132
|
let allFound = true;
|
|
12674
|
-
for (const aValue of
|
|
13133
|
+
for (const aValue of a) if (!b2.has(aValue)) {
|
|
12675
13134
|
let has = false;
|
|
12676
13135
|
for (const bValue of b2) if (equals(aValue, bValue, filteredCustomTesters) === true) has = true;
|
|
12677
13136
|
if (has === false) {
|
|
@@ -12682,9 +13141,9 @@ function iterableEquality(a2, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
12682
13141
|
aStack.pop();
|
|
12683
13142
|
bStack.pop();
|
|
12684
13143
|
return allFound;
|
|
12685
|
-
} else if (isA("Map",
|
|
13144
|
+
} else if (isA("Map", a) || isImmutableUnorderedKeyed(a)) {
|
|
12686
13145
|
let allFound = true;
|
|
12687
|
-
for (const aEntry of
|
|
13146
|
+
for (const aEntry of a) if (!b2.has(aEntry[0]) || !equals(aEntry[1], b2.get(aEntry[0]), filteredCustomTesters)) {
|
|
12688
13147
|
let has = false;
|
|
12689
13148
|
for (const bEntry of b2) {
|
|
12690
13149
|
const matchedKey = equals(aEntry[0], bEntry[0], filteredCustomTesters);
|
|
@@ -12703,13 +13162,13 @@ function iterableEquality(a2, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
12703
13162
|
}
|
|
12704
13163
|
}
|
|
12705
13164
|
const bIterator = b2[IteratorSymbol]();
|
|
12706
|
-
for (const aValue of
|
|
13165
|
+
for (const aValue of a) {
|
|
12707
13166
|
const nextB = bIterator.next();
|
|
12708
13167
|
if (nextB.done || !equals(aValue, nextB.value, filteredCustomTesters)) return false;
|
|
12709
13168
|
}
|
|
12710
13169
|
if (!bIterator.next().done) return false;
|
|
12711
|
-
if (!isImmutableList(
|
|
12712
|
-
if (!equals(Object.entries(
|
|
13170
|
+
if (!isImmutableList(a) && !isImmutableOrderedKeyed(a) && !isImmutableOrderedSet(a) && !isImmutableRecord(a)) {
|
|
13171
|
+
if (!equals(Object.entries(a), Object.entries(b2), filteredCustomTesters)) return false;
|
|
12713
13172
|
}
|
|
12714
13173
|
aStack.pop();
|
|
12715
13174
|
bStack.pop();
|
|
@@ -12719,8 +13178,8 @@ function hasPropertyInObject(object2, key) {
|
|
|
12719
13178
|
if (!object2 || typeof object2 !== "object" || object2 === Object.prototype) return false;
|
|
12720
13179
|
return Object.hasOwn(object2, key) || hasPropertyInObject(Object.getPrototypeOf(object2), key);
|
|
12721
13180
|
}
|
|
12722
|
-
function isObjectWithKeys(
|
|
12723
|
-
return isObject(
|
|
13181
|
+
function isObjectWithKeys(a) {
|
|
13182
|
+
return isObject(a) && !isError(a) && !Array.isArray(a) && !(a instanceof Date) && !(a instanceof Set) && !(a instanceof Map);
|
|
12724
13183
|
}
|
|
12725
13184
|
var subsetEqualityTesters = /* @__PURE__ */ new WeakSet();
|
|
12726
13185
|
function registerSubsetEqualityTester(tester) {
|
|
@@ -12731,7 +13190,7 @@ function isSubsetEqualityTester(tester) {
|
|
|
12731
13190
|
return tester === subsetEquality || subsetEqualityTesters.has(tester);
|
|
12732
13191
|
}
|
|
12733
13192
|
function subsetEquality(object2, subset, customTesters = []) {
|
|
12734
|
-
const filteredCustomTesters = customTesters.filter((
|
|
13193
|
+
const filteredCustomTesters = customTesters.filter((t3) => t3 !== subsetEquality);
|
|
12735
13194
|
const subsetEqualityWithContext = (seenReferences = /* @__PURE__ */ new WeakMap()) => registerSubsetEqualityTester((object3, subset2) => {
|
|
12736
13195
|
if (!isObjectWithKeys(subset2)) return;
|
|
12737
13196
|
return Object.keys(subset2).every((key) => {
|
|
@@ -12746,17 +13205,17 @@ function subsetEquality(object2, subset, customTesters = []) {
|
|
|
12746
13205
|
});
|
|
12747
13206
|
return subsetEqualityWithContext()(object2, subset);
|
|
12748
13207
|
}
|
|
12749
|
-
function typeEquality(
|
|
12750
|
-
if (
|
|
13208
|
+
function typeEquality(a, b2) {
|
|
13209
|
+
if (a == null || b2 == null || a.constructor === b2.constructor) return;
|
|
12751
13210
|
return false;
|
|
12752
13211
|
}
|
|
12753
|
-
function arrayBufferEquality(
|
|
12754
|
-
let dataViewA =
|
|
13212
|
+
function arrayBufferEquality(a, b2) {
|
|
13213
|
+
let dataViewA = a;
|
|
12755
13214
|
let dataViewB = b2;
|
|
12756
|
-
if (!(
|
|
12757
|
-
if (!(
|
|
13215
|
+
if (!(a instanceof DataView && b2 instanceof DataView)) {
|
|
13216
|
+
if (!(a instanceof ArrayBuffer) || !(b2 instanceof ArrayBuffer)) return;
|
|
12758
13217
|
try {
|
|
12759
|
-
dataViewA = new DataView(
|
|
13218
|
+
dataViewA = new DataView(a);
|
|
12760
13219
|
dataViewB = new DataView(b2);
|
|
12761
13220
|
} catch {
|
|
12762
13221
|
return;
|
|
@@ -12766,11 +13225,11 @@ function arrayBufferEquality(a2, b2) {
|
|
|
12766
13225
|
for (let i3 = 0; i3 < dataViewA.byteLength; i3++) if (dataViewA.getUint8(i3) !== dataViewB.getUint8(i3)) return false;
|
|
12767
13226
|
return true;
|
|
12768
13227
|
}
|
|
12769
|
-
function sparseArrayEquality(
|
|
12770
|
-
if (!Array.isArray(
|
|
12771
|
-
const aKeys = Object.keys(
|
|
13228
|
+
function sparseArrayEquality(a, b2, customTesters = []) {
|
|
13229
|
+
if (!Array.isArray(a) || !Array.isArray(b2)) return;
|
|
13230
|
+
const aKeys = Object.keys(a);
|
|
12772
13231
|
const bKeys = Object.keys(b2);
|
|
12773
|
-
return equals(
|
|
13232
|
+
return equals(a, b2, customTesters.filter((t3) => t3 !== sparseArrayEquality), true) && equals(aKeys, bKeys);
|
|
12774
13233
|
}
|
|
12775
13234
|
function generateToBeMessage(deepEqualityName, expected = "#{this}", actual = "#{exp}") {
|
|
12776
13235
|
const toBeMessage = `expected ${expected} to be ${actual} // Object.is equality`;
|
|
@@ -13110,8 +13569,8 @@ function recordAsyncExpect(_test2, promise, assertion, error, isSoft) {
|
|
|
13110
13569
|
if (test5 && promise instanceof Promise) {
|
|
13111
13570
|
promise = promise.finally(() => {
|
|
13112
13571
|
if (!test5.promises) return;
|
|
13113
|
-
const
|
|
13114
|
-
if (
|
|
13572
|
+
const index2 = test5.promises.indexOf(promise);
|
|
13573
|
+
if (index2 !== -1) test5.promises.splice(index2, 1);
|
|
13115
13574
|
});
|
|
13116
13575
|
if (!test5.promises) test5.promises = [];
|
|
13117
13576
|
if (isSoft) promise = promise.then(noop, (err) => {
|
|
@@ -13149,10 +13608,10 @@ await ${assertion}
|
|
|
13149
13608
|
return promise;
|
|
13150
13609
|
}
|
|
13151
13610
|
function handleTestError(test5, err) {
|
|
13152
|
-
var
|
|
13611
|
+
var _a;
|
|
13153
13612
|
test5.result || (test5.result = { state: "fail" });
|
|
13154
13613
|
test5.result.state = "fail";
|
|
13155
|
-
(
|
|
13614
|
+
(_a = test5.result).errors || (_a.errors = []);
|
|
13156
13615
|
test5.result.errors.push(processError(err));
|
|
13157
13616
|
}
|
|
13158
13617
|
function wrapAssertion(utils, name, fn2) {
|
|
@@ -13180,12 +13639,12 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13180
13639
|
const { AssertionError: AssertionError2 } = chai;
|
|
13181
13640
|
const customTesters = getCustomEqualityTesters();
|
|
13182
13641
|
function def(name, fn2) {
|
|
13183
|
-
const addMethod2 = (
|
|
13184
|
-
const softWrapper = wrapAssertion(utils,
|
|
13185
|
-
utils.addMethod(chai.Assertion.prototype,
|
|
13186
|
-
utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers,
|
|
13642
|
+
const addMethod2 = (n2) => {
|
|
13643
|
+
const softWrapper = wrapAssertion(utils, n2, fn2);
|
|
13644
|
+
utils.addMethod(chai.Assertion.prototype, n2, softWrapper);
|
|
13645
|
+
utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers, n2, softWrapper);
|
|
13187
13646
|
};
|
|
13188
|
-
if (Array.isArray(name)) name.forEach((
|
|
13647
|
+
if (Array.isArray(name)) name.forEach((n2) => addMethod2(n2));
|
|
13189
13648
|
else addMethod2(name);
|
|
13190
13649
|
}
|
|
13191
13650
|
[
|
|
@@ -13201,10 +13660,12 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13201
13660
|
if (promise === "rejects") utils.flag(this, "object", () => {
|
|
13202
13661
|
throw object2;
|
|
13203
13662
|
});
|
|
13204
|
-
else if (promise === "resolves" && typeof object2 !== "function")
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13663
|
+
else if (promise === "resolves" && typeof object2 !== "function") {
|
|
13664
|
+
if (!isNot) {
|
|
13665
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
13666
|
+
throw new AssertionError2(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
13667
|
+
} else return;
|
|
13668
|
+
}
|
|
13208
13669
|
_super.apply(this, args);
|
|
13209
13670
|
};
|
|
13210
13671
|
});
|
|
@@ -13294,10 +13755,10 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13294
13755
|
});
|
|
13295
13756
|
def("toContainEqual", function(expected) {
|
|
13296
13757
|
const obj = utils.flag(this, "object");
|
|
13297
|
-
const
|
|
13298
|
-
return equals(item, expected, customTesters);
|
|
13758
|
+
const index2 = Array.from(obj).findIndex((item) => {
|
|
13759
|
+
return equals(item, expected, [...customTesters, iterableEquality]);
|
|
13299
13760
|
});
|
|
13300
|
-
this.assert(
|
|
13761
|
+
this.assert(index2 !== -1, "expected #{this} to deep equally contain #{exp}", "expected #{this} to not deep equally contain #{exp}", expected);
|
|
13301
13762
|
});
|
|
13302
13763
|
def("toBeTruthy", function() {
|
|
13303
13764
|
const obj = utils.flag(this, "object");
|
|
@@ -13375,7 +13836,7 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13375
13836
|
return utils.getPathInfo(actual, propertyName);
|
|
13376
13837
|
};
|
|
13377
13838
|
const { value, exists } = getValue();
|
|
13378
|
-
const pass = exists && (args.length === 1 || equals(expected, value, customTesters));
|
|
13839
|
+
const pass = exists && (args.length === 1 || equals(expected, value, [...customTesters, iterableEquality]));
|
|
13379
13840
|
const valueString = args.length === 1 ? "" : ` with value ${inspect(expected, { truncate: 40 })}`;
|
|
13380
13841
|
return this.assert(pass, `expected #{this} to have property "${propertyName}"${valueString}`, `expected #{this} to not have property "${propertyName}"${valueString}`, expected, exists ? value : void 0);
|
|
13381
13842
|
});
|
|
@@ -13428,8 +13889,8 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13428
13889
|
if (called && isNot) msg = formatCalls(spy, msg);
|
|
13429
13890
|
if (called && isNot || !called && !isNot) throw new AssertionError2(msg);
|
|
13430
13891
|
});
|
|
13431
|
-
function equalsArgumentArray(
|
|
13432
|
-
return
|
|
13892
|
+
function equalsArgumentArray(a, b2) {
|
|
13893
|
+
return a.length === b2.length && a.every((aItem, i3) => equals(aItem, b2[i3], [...customTesters, iterableEquality]));
|
|
13433
13894
|
}
|
|
13434
13895
|
def(["toHaveBeenCalledWith", "toBeCalledWith"], function(...args) {
|
|
13435
13896
|
const spy = getSpy(this);
|
|
@@ -13500,11 +13961,12 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13500
13961
|
const isNot = utils.flag(this, "negate");
|
|
13501
13962
|
let thrown = null;
|
|
13502
13963
|
if (promise === "rejects") thrown = obj;
|
|
13503
|
-
else if (promise === "resolves" && typeof obj !== "function")
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
|
|
13964
|
+
else if (promise === "resolves" && typeof obj !== "function") {
|
|
13965
|
+
if (!isNot) {
|
|
13966
|
+
const message = utils.flag(this, "message") || "expected promise to throw an error, but it didn't";
|
|
13967
|
+
throw new AssertionError2(message, { showDiff: false }, utils.flag(this, "ssfi"));
|
|
13968
|
+
} else return;
|
|
13969
|
+
} else {
|
|
13508
13970
|
let isThrow = false;
|
|
13509
13971
|
try {
|
|
13510
13972
|
obj();
|
|
@@ -13527,7 +13989,7 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13527
13989
|
}
|
|
13528
13990
|
if (typeof expected === "object" && "asymmetricMatch" in expected && typeof expected.asymmetricMatch === "function") {
|
|
13529
13991
|
const matcher = expected;
|
|
13530
|
-
return this.assert(thrown && matcher.asymmetricMatch(thrown), "expected error to match asymmetric matcher", "expected error not to match asymmetric matcher", matcher, thrown);
|
|
13992
|
+
return this.assert(thrown && matcher.asymmetricMatch(thrown, [...customTesters, iterableEquality]), "expected error to match asymmetric matcher", "expected error not to match asymmetric matcher", matcher, thrown);
|
|
13531
13993
|
}
|
|
13532
13994
|
const equal = equals(thrown, expected, [...customTesters, iterableEquality]);
|
|
13533
13995
|
return this.assert(equal, "expected a thrown value to equal #{exp}", "expected a thrown value not to equal #{exp}", expected, thrown);
|
|
@@ -13566,11 +14028,11 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13566
14028
|
});
|
|
13567
14029
|
[{
|
|
13568
14030
|
name: "toHaveResolvedWith",
|
|
13569
|
-
condition: (spy, value) => spy.mock.settledResults.some(({ type: type3, value: result }) => type3 === "fulfilled" && equals(value, result)),
|
|
14031
|
+
condition: (spy, value) => spy.mock.settledResults.some(({ type: type3, value: result }) => type3 === "fulfilled" && equals(value, result, [...customTesters, iterableEquality])),
|
|
13570
14032
|
action: "resolve"
|
|
13571
14033
|
}, {
|
|
13572
14034
|
name: ["toHaveReturnedWith", "toReturnWith"],
|
|
13573
|
-
condition: (spy, value) => spy.mock.results.some(({ type: type3, value: result }) => type3 === "return" && equals(value, result)),
|
|
14035
|
+
condition: (spy, value) => spy.mock.results.some(({ type: type3, value: result }) => type3 === "return" && equals(value, result, [...customTesters, iterableEquality])),
|
|
13574
14036
|
action: "return"
|
|
13575
14037
|
}].forEach(({ name, condition, action }) => {
|
|
13576
14038
|
def(name, function(value) {
|
|
@@ -13594,14 +14056,14 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13594
14056
|
name: "toHaveLastResolvedWith",
|
|
13595
14057
|
condition: (spy, value) => {
|
|
13596
14058
|
const result = spy.mock.settledResults.at(-1);
|
|
13597
|
-
return Boolean(result && result.type === "fulfilled" && equals(result.value, value));
|
|
14059
|
+
return Boolean(result && result.type === "fulfilled" && equals(result.value, value, [...customTesters, iterableEquality]));
|
|
13598
14060
|
},
|
|
13599
14061
|
action: "resolve"
|
|
13600
14062
|
}, {
|
|
13601
14063
|
name: "toHaveLastReturnedWith",
|
|
13602
14064
|
condition: (spy, value) => {
|
|
13603
14065
|
const result = spy.mock.results.at(-1);
|
|
13604
|
-
return Boolean(result && result.type === "return" && equals(result.value, value));
|
|
14066
|
+
return Boolean(result && result.type === "return" && equals(result.value, value, [...customTesters, iterableEquality]));
|
|
13605
14067
|
},
|
|
13606
14068
|
action: "return"
|
|
13607
14069
|
}].forEach(({ name, condition, action }) => {
|
|
@@ -13614,16 +14076,16 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13614
14076
|
});
|
|
13615
14077
|
[{
|
|
13616
14078
|
name: "toHaveNthResolvedWith",
|
|
13617
|
-
condition: (spy,
|
|
13618
|
-
const result = spy.mock.settledResults[
|
|
13619
|
-
return result && result.type === "fulfilled" && equals(result.value, value);
|
|
14079
|
+
condition: (spy, index2, value) => {
|
|
14080
|
+
const result = spy.mock.settledResults[index2 - 1];
|
|
14081
|
+
return result && result.type === "fulfilled" && equals(result.value, value, [...customTesters, iterableEquality]);
|
|
13620
14082
|
},
|
|
13621
14083
|
action: "resolve"
|
|
13622
14084
|
}, {
|
|
13623
14085
|
name: "toHaveNthReturnedWith",
|
|
13624
|
-
condition: (spy,
|
|
13625
|
-
const result = spy.mock.results[
|
|
13626
|
-
return result && result.type === "return" && equals(result.value, value);
|
|
14086
|
+
condition: (spy, index2, value) => {
|
|
14087
|
+
const result = spy.mock.results[index2 - 1];
|
|
14088
|
+
return result && result.type === "return" && equals(result.value, value, [...customTesters, iterableEquality]);
|
|
13627
14089
|
},
|
|
13628
14090
|
action: "return"
|
|
13629
14091
|
}].forEach(({ name, condition, action }) => {
|
|
@@ -13702,12 +14164,12 @@ var JestChaiExpect = (chai, utils) => {
|
|
|
13702
14164
|
});
|
|
13703
14165
|
};
|
|
13704
14166
|
function formatCalls(spy, msg, showActualCall) {
|
|
13705
|
-
if (spy.mock.calls.length) msg +=
|
|
14167
|
+
if (spy.mock.calls.length) msg += $.gray(`
|
|
13706
14168
|
|
|
13707
14169
|
Received:
|
|
13708
14170
|
|
|
13709
14171
|
${spy.mock.calls.map((callArg, i3) => {
|
|
13710
|
-
let methodCall =
|
|
14172
|
+
let methodCall = $.bold(` ${ordinal(i3 + 1)} ${spy.getMockName()} call:
|
|
13711
14173
|
|
|
13712
14174
|
`);
|
|
13713
14175
|
if (showActualCall) methodCall += diff(showActualCall, callArg, { omitAnnotationLines: true });
|
|
@@ -13715,19 +14177,19 @@ ${spy.mock.calls.map((callArg, i3) => {
|
|
|
13715
14177
|
methodCall += "\n";
|
|
13716
14178
|
return methodCall;
|
|
13717
14179
|
}).join("\n")}`);
|
|
13718
|
-
msg +=
|
|
14180
|
+
msg += $.gray(`
|
|
13719
14181
|
|
|
13720
|
-
Number of calls: ${
|
|
14182
|
+
Number of calls: ${$.bold(spy.mock.calls.length)}
|
|
13721
14183
|
`);
|
|
13722
14184
|
return msg;
|
|
13723
14185
|
}
|
|
13724
14186
|
function formatReturns(spy, results, msg, showActualReturn) {
|
|
13725
|
-
if (results.length) msg +=
|
|
14187
|
+
if (results.length) msg += $.gray(`
|
|
13726
14188
|
|
|
13727
14189
|
Received:
|
|
13728
14190
|
|
|
13729
14191
|
${results.map((callReturn, i3) => {
|
|
13730
|
-
let methodCall =
|
|
14192
|
+
let methodCall = $.bold(` ${ordinal(i3 + 1)} ${spy.getMockName()} call return:
|
|
13731
14193
|
|
|
13732
14194
|
`);
|
|
13733
14195
|
if (showActualReturn) methodCall += diff(showActualReturn, callReturn.value, { omitAnnotationLines: true });
|
|
@@ -13735,9 +14197,9 @@ ${results.map((callReturn, i3) => {
|
|
|
13735
14197
|
methodCall += "\n";
|
|
13736
14198
|
return methodCall;
|
|
13737
14199
|
}).join("\n")}`);
|
|
13738
|
-
msg +=
|
|
14200
|
+
msg += $.gray(`
|
|
13739
14201
|
|
|
13740
|
-
Number of calls: ${
|
|
14202
|
+
Number of calls: ${$.bold(spy.mock.calls.length)}
|
|
13741
14203
|
`);
|
|
13742
14204
|
return msg;
|
|
13743
14205
|
}
|
|
@@ -13789,8 +14251,8 @@ var JestExtendError = class extends Error {
|
|
|
13789
14251
|
this.__vitest_error_context__ = __vitest_error_context__;
|
|
13790
14252
|
}
|
|
13791
14253
|
};
|
|
13792
|
-
function JestExtendPlugin(
|
|
13793
|
-
return (
|
|
14254
|
+
function JestExtendPlugin(c2, expect2, matchers) {
|
|
14255
|
+
return (_2, utils) => {
|
|
13794
14256
|
Object.entries(matchers).forEach(([expectAssertionName, expectAssertion]) => {
|
|
13795
14257
|
function __VITEST_EXTEND_ASSERTION__(...args) {
|
|
13796
14258
|
const { state, isNot, obj, customMessage } = getMatcherState(this, expect2);
|
|
@@ -13815,17 +14277,21 @@ function JestExtendPlugin(c, expect2, matchers) {
|
|
|
13815
14277
|
}
|
|
13816
14278
|
const softWrapper = wrapAssertion(utils, expectAssertionName, __VITEST_EXTEND_ASSERTION__);
|
|
13817
14279
|
utils.addMethod(globalThis[JEST_MATCHERS_OBJECT].matchers, expectAssertionName, softWrapper);
|
|
13818
|
-
utils.addMethod(
|
|
14280
|
+
utils.addMethod(c2.Assertion.prototype, expectAssertionName, softWrapper);
|
|
13819
14281
|
if (expectAssertion.__vitest_poll_takeover__) {
|
|
13820
|
-
const addedMethod =
|
|
14282
|
+
const addedMethod = c2.Assertion.prototype[expectAssertionName];
|
|
13821
14283
|
Object.defineProperty(addedMethod, "__vitest_poll_takeover__", { value: true });
|
|
13822
14284
|
}
|
|
13823
14285
|
class CustomMatcher extends AsymmetricMatcher4 {
|
|
13824
14286
|
constructor(inverse = false, ...sample) {
|
|
13825
14287
|
super(sample, inverse);
|
|
13826
14288
|
}
|
|
13827
|
-
asymmetricMatch(other) {
|
|
13828
|
-
const
|
|
14289
|
+
asymmetricMatch(other, customTesters) {
|
|
14290
|
+
const context = this.getMatcherContext(expect2);
|
|
14291
|
+
const { pass } = expectAssertion.call(customTesters ? {
|
|
14292
|
+
...context,
|
|
14293
|
+
customTesters
|
|
14294
|
+
} : context, other, ...this.sample);
|
|
13829
14295
|
return this.inverse ? !pass : pass;
|
|
13830
14296
|
}
|
|
13831
14297
|
toString() {
|
|
@@ -13957,7 +14423,7 @@ function requireThrowsOnProto() {
|
|
|
13957
14423
|
const object2 = {};
|
|
13958
14424
|
object2.__proto__;
|
|
13959
14425
|
throwsOnProto = false;
|
|
13960
|
-
} catch (
|
|
14426
|
+
} catch (_2) {
|
|
13961
14427
|
throwsOnProto = true;
|
|
13962
14428
|
}
|
|
13963
14429
|
throwsOnProto_1 = throwsOnProto;
|
|
@@ -14018,10 +14484,10 @@ function requireCalledInOrder() {
|
|
|
14018
14484
|
}
|
|
14019
14485
|
return callMap[spy.id] < spy.callCount;
|
|
14020
14486
|
}
|
|
14021
|
-
function checkAdjacentCalls(callMap, spy,
|
|
14487
|
+
function checkAdjacentCalls(callMap, spy, index2, spies) {
|
|
14022
14488
|
var calledBeforeNext = true;
|
|
14023
|
-
if (
|
|
14024
|
-
calledBeforeNext = spy.calledBefore(spies[
|
|
14489
|
+
if (index2 !== spies.length - 1) {
|
|
14490
|
+
calledBeforeNext = spy.calledBefore(spies[index2 + 1]);
|
|
14025
14491
|
}
|
|
14026
14492
|
if (hasCallsLeft(callMap, spy) && calledBeforeNext) {
|
|
14027
14493
|
callMap[spy.id] += 1;
|
|
@@ -14093,7 +14559,7 @@ function requireEvery() {
|
|
|
14093
14559
|
throw new Error();
|
|
14094
14560
|
}
|
|
14095
14561
|
});
|
|
14096
|
-
} catch (
|
|
14562
|
+
} catch (e2) {
|
|
14097
14563
|
pass = false;
|
|
14098
14564
|
}
|
|
14099
14565
|
return pass;
|
|
@@ -14115,7 +14581,7 @@ function requireFunctionName() {
|
|
|
14115
14581
|
// doesn't debugging will be slightly less informative
|
|
14116
14582
|
// (i.e. toString will say 'spy' rather than 'myFunc').
|
|
14117
14583
|
(String(func).match(/function ([^\s(]+)/) || [])[1];
|
|
14118
|
-
} catch (
|
|
14584
|
+
} catch (e2) {
|
|
14119
14585
|
return "";
|
|
14120
14586
|
}
|
|
14121
14587
|
};
|
|
@@ -14128,8 +14594,8 @@ function requireOrderByFirstCall() {
|
|
|
14128
14594
|
hasRequiredOrderByFirstCall = 1;
|
|
14129
14595
|
var sort2 = requireArray().sort;
|
|
14130
14596
|
var slice = requireArray().slice;
|
|
14131
|
-
function comparator(
|
|
14132
|
-
var aCall =
|
|
14597
|
+
function comparator(a, b2) {
|
|
14598
|
+
var aCall = a.getCall(0);
|
|
14133
14599
|
var bCall = b2.getCall(0);
|
|
14134
14600
|
var aId = aCall && aCall.callId || -1;
|
|
14135
14601
|
var bId = bCall && bCall.callId || -1;
|
|
@@ -14766,18 +15232,18 @@ ${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
|
14766
15232
|
* @returns {boolean}
|
|
14767
15233
|
*/
|
|
14768
15234
|
remove(timer) {
|
|
14769
|
-
const
|
|
14770
|
-
if (
|
|
15235
|
+
const index2 = timer.heapIndex;
|
|
15236
|
+
if (index2 === void 0 || this.timers[index2] !== timer) {
|
|
14771
15237
|
return false;
|
|
14772
15238
|
}
|
|
14773
15239
|
const last = this.timers.pop();
|
|
14774
15240
|
if (timer !== last) {
|
|
14775
|
-
this.timers[
|
|
14776
|
-
last.heapIndex =
|
|
15241
|
+
this.timers[index2] = last;
|
|
15242
|
+
last.heapIndex = index2;
|
|
14777
15243
|
if (compareTimers(last, timer) < 0) {
|
|
14778
|
-
this.bubbleUp(
|
|
15244
|
+
this.bubbleUp(index2);
|
|
14779
15245
|
} else {
|
|
14780
|
-
this.bubbleDown(
|
|
15246
|
+
this.bubbleDown(index2);
|
|
14781
15247
|
}
|
|
14782
15248
|
}
|
|
14783
15249
|
delete timer.heapIndex;
|
|
@@ -14792,9 +15258,9 @@ ${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
|
14792
15258
|
* swapping it upward until it is no longer out of place.
|
|
14793
15259
|
* @param {number} index
|
|
14794
15260
|
*/
|
|
14795
|
-
bubbleUp(
|
|
14796
|
-
const timer = this.timers[
|
|
14797
|
-
let currentIndex =
|
|
15261
|
+
bubbleUp(index2) {
|
|
15262
|
+
const timer = this.timers[index2];
|
|
15263
|
+
let currentIndex = index2;
|
|
14798
15264
|
while (currentIndex > 0) {
|
|
14799
15265
|
const parentIndex = Math.floor((currentIndex - 1) / 2);
|
|
14800
15266
|
const parent = this.timers[parentIndex];
|
|
@@ -14819,9 +15285,9 @@ ${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
|
14819
15285
|
* room is ordered again.
|
|
14820
15286
|
* @param {number} index
|
|
14821
15287
|
*/
|
|
14822
|
-
bubbleDown(
|
|
14823
|
-
const timer = this.timers[
|
|
14824
|
-
let currentIndex =
|
|
15288
|
+
bubbleDown(index2) {
|
|
15289
|
+
const timer = this.timers[index2];
|
|
15290
|
+
let currentIndex = index2;
|
|
14825
15291
|
const halfLength = Math.floor(this.timers.length / 2);
|
|
14826
15292
|
while (currentIndex < halfLength) {
|
|
14827
15293
|
const leftIndex = currentIndex * 2 + 1;
|
|
@@ -14960,41 +15426,41 @@ ${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
|
14960
15426
|
}
|
|
14961
15427
|
return timer.id;
|
|
14962
15428
|
}
|
|
14963
|
-
function compareTimers(
|
|
14964
|
-
if (
|
|
15429
|
+
function compareTimers(a, b2) {
|
|
15430
|
+
if (a.type === "IdleCallback" && b2.type !== "IdleCallback") {
|
|
14965
15431
|
return 1;
|
|
14966
15432
|
}
|
|
14967
|
-
if (
|
|
15433
|
+
if (a.type !== "IdleCallback" && b2.type === "IdleCallback") {
|
|
14968
15434
|
return -1;
|
|
14969
15435
|
}
|
|
14970
|
-
if (
|
|
15436
|
+
if (a.callAt < b2.callAt) {
|
|
14971
15437
|
return -1;
|
|
14972
15438
|
}
|
|
14973
|
-
if (
|
|
15439
|
+
if (a.callAt > b2.callAt) {
|
|
14974
15440
|
return 1;
|
|
14975
15441
|
}
|
|
14976
|
-
if (
|
|
15442
|
+
if (a.immediate && !b2.immediate) {
|
|
14977
15443
|
return -1;
|
|
14978
15444
|
}
|
|
14979
|
-
if (!
|
|
15445
|
+
if (!a.immediate && b2.immediate) {
|
|
14980
15446
|
return 1;
|
|
14981
15447
|
}
|
|
14982
|
-
if (
|
|
15448
|
+
if (a.order < b2.order) {
|
|
14983
15449
|
return -1;
|
|
14984
15450
|
}
|
|
14985
|
-
if (
|
|
15451
|
+
if (a.order > b2.order) {
|
|
14986
15452
|
return 1;
|
|
14987
15453
|
}
|
|
14988
|
-
if (
|
|
15454
|
+
if (a.createdAt < b2.createdAt) {
|
|
14989
15455
|
return -1;
|
|
14990
15456
|
}
|
|
14991
|
-
if (
|
|
15457
|
+
if (a.createdAt > b2.createdAt) {
|
|
14992
15458
|
return 1;
|
|
14993
15459
|
}
|
|
14994
|
-
if (
|
|
15460
|
+
if (a.id < b2.id) {
|
|
14995
15461
|
return -1;
|
|
14996
15462
|
}
|
|
14997
|
-
if (
|
|
15463
|
+
if (a.id > b2.id) {
|
|
14998
15464
|
return 1;
|
|
14999
15465
|
}
|
|
15000
15466
|
return 0;
|
|
@@ -15523,8 +15989,8 @@ ${stackTrace}`
|
|
|
15523
15989
|
try {
|
|
15524
15990
|
runJobs(clock);
|
|
15525
15991
|
callTimer(clock, state.timer);
|
|
15526
|
-
} catch (
|
|
15527
|
-
state.firstException = state.firstException ||
|
|
15992
|
+
} catch (e2) {
|
|
15993
|
+
state.firstException = state.firstException || e2;
|
|
15528
15994
|
}
|
|
15529
15995
|
if (isAsync) {
|
|
15530
15996
|
originalSetTimeout(nextPromiseTick);
|
|
@@ -15545,8 +16011,8 @@ ${stackTrace}`
|
|
|
15545
16011
|
if (state.timer) {
|
|
15546
16012
|
try {
|
|
15547
16013
|
clock.tick(state.tickTo - clock.now);
|
|
15548
|
-
} catch (
|
|
15549
|
-
state.firstException = state.firstException ||
|
|
16014
|
+
} catch (e2) {
|
|
16015
|
+
state.firstException = state.firstException || e2;
|
|
15550
16016
|
}
|
|
15551
16017
|
} else {
|
|
15552
16018
|
clock.now = state.tickTo;
|
|
@@ -15576,8 +16042,8 @@ ${stackTrace}`
|
|
|
15576
16042
|
compensationCheck();
|
|
15577
16043
|
selectNextTimerInRange(state);
|
|
15578
16044
|
doTickInner();
|
|
15579
|
-
} catch (
|
|
15580
|
-
reject(
|
|
16045
|
+
} catch (e2) {
|
|
16046
|
+
reject(e2);
|
|
15581
16047
|
}
|
|
15582
16048
|
};
|
|
15583
16049
|
function doTickInner() {
|
|
@@ -15620,8 +16086,8 @@ ${stackTrace}`
|
|
|
15620
16086
|
originalSetTimeout(function() {
|
|
15621
16087
|
try {
|
|
15622
16088
|
callback(resolve2, reject);
|
|
15623
|
-
} catch (
|
|
15624
|
-
reject(
|
|
16089
|
+
} catch (e2) {
|
|
16090
|
+
reject(e2);
|
|
15625
16091
|
}
|
|
15626
16092
|
});
|
|
15627
16093
|
})
|
|
@@ -15674,8 +16140,8 @@ ${stackTrace}`
|
|
|
15674
16140
|
clock.now = timer.callAt;
|
|
15675
16141
|
try {
|
|
15676
16142
|
callTimer(clock, timer);
|
|
15677
|
-
} catch (
|
|
15678
|
-
err =
|
|
16143
|
+
} catch (e2) {
|
|
16144
|
+
err = e2;
|
|
15679
16145
|
}
|
|
15680
16146
|
clock.duringTick = false;
|
|
15681
16147
|
originalSetTimeout(function() {
|
|
@@ -15715,8 +16181,8 @@ ${stackTrace}`
|
|
|
15715
16181
|
}
|
|
15716
16182
|
const excessJob = firstTimer(clock);
|
|
15717
16183
|
reject(getInfiniteLoopError(clock, excessJob));
|
|
15718
|
-
} catch (
|
|
15719
|
-
reject(
|
|
16184
|
+
} catch (e2) {
|
|
16185
|
+
reject(e2);
|
|
15720
16186
|
}
|
|
15721
16187
|
}
|
|
15722
16188
|
return runAsyncWithNativeTimeout(function(resolve2, reject) {
|
|
@@ -16318,13 +16784,15 @@ var FakeTimers = class {
|
|
|
16318
16784
|
return 0;
|
|
16319
16785
|
}
|
|
16320
16786
|
setTimerTickMode(mode, interval) {
|
|
16321
|
-
if (this._checkFakeTimers())
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
mode
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16787
|
+
if (this._checkFakeTimers()) {
|
|
16788
|
+
if (mode === "manual") this._clock.setTickMode({ mode: "manual" });
|
|
16789
|
+
else if (mode === "nextTimerAsync") this._clock.setTickMode({ mode: "nextAsync" });
|
|
16790
|
+
else if (mode === "interval") this._clock.setTickMode({
|
|
16791
|
+
mode: "interval",
|
|
16792
|
+
delta: interval
|
|
16793
|
+
});
|
|
16794
|
+
else throw new Error(`Invalid tick mode: ${mode}`);
|
|
16795
|
+
}
|
|
16328
16796
|
}
|
|
16329
16797
|
configure(config2) {
|
|
16330
16798
|
this._userConfig = config2;
|
|
@@ -16463,10 +16931,10 @@ function markWhenChain(input) {
|
|
|
16463
16931
|
return input;
|
|
16464
16932
|
}
|
|
16465
16933
|
function formatActions(actions) {
|
|
16466
|
-
const lines = actions.map((action,
|
|
16934
|
+
const lines = actions.map((action, index2) => {
|
|
16467
16935
|
const method = getMethodName(action.type);
|
|
16468
16936
|
const left = ` ${getSymbol(action)} ${method}(${stringify(action.value)}${action.times === Number.POSITIVE_INFINITY ? "" : `, { times: ${action.times} }`})`;
|
|
16469
|
-
const unreachable = !hasBeenConsumed(action) && actions.slice(
|
|
16937
|
+
const unreachable = !hasBeenConsumed(action) && actions.slice(index2 + 1).some((later) => later.times === Number.POSITIVE_INFINITY);
|
|
16470
16938
|
return {
|
|
16471
16939
|
left,
|
|
16472
16940
|
remaining: getRemainingLabel(action) + (unreachable ? " \u2192 unreachable action" : "")
|
|
@@ -16833,7 +17301,7 @@ function createVitest() {
|
|
|
16833
17301
|
var vitest = createVitest();
|
|
16834
17302
|
var vi = vitest;
|
|
16835
17303
|
function _mocker() {
|
|
16836
|
-
return typeof __vitest_mocker__ !== "undefined" ? __vitest_mocker__ : new Proxy({}, { get(
|
|
17304
|
+
return typeof __vitest_mocker__ !== "undefined" ? __vitest_mocker__ : new Proxy({}, { get(_2, name) {
|
|
16837
17305
|
throw new Error(`Vitest mocker was not initialized in this environment. vi.${String(name)}() is forbidden.`);
|
|
16838
17306
|
} });
|
|
16839
17307
|
}
|
|
@@ -16857,7 +17325,7 @@ async function waitForImportsToResolve() {
|
|
|
16857
17325
|
const state = getWorkerState();
|
|
16858
17326
|
const promises = [];
|
|
16859
17327
|
const resolvingCount = state.resolvingModules.size;
|
|
16860
|
-
for (const [
|
|
17328
|
+
for (const [_2, mod] of state.evaluatedModules.idToModuleMap) if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
16861
17329
|
if (!promises.length && !resolvingCount) return;
|
|
16862
17330
|
await Promise.allSettled(promises);
|
|
16863
17331
|
await waitForImportsToResolve();
|
|
@@ -17037,8 +17505,8 @@ function getError(expected, promise) {
|
|
|
17037
17505
|
}
|
|
17038
17506
|
try {
|
|
17039
17507
|
expected();
|
|
17040
|
-
} catch (
|
|
17041
|
-
return
|
|
17508
|
+
} catch (e2) {
|
|
17509
|
+
return e2;
|
|
17042
17510
|
}
|
|
17043
17511
|
throw new Error("snapshot function didn't throw");
|
|
17044
17512
|
}
|
|
@@ -17260,7 +17728,7 @@ var kPerProject = Symbol("perProject");
|
|
|
17260
17728
|
var kWriteResult = Symbol("writeResult");
|
|
17261
17729
|
var kFinalize = Symbol("finalize");
|
|
17262
17730
|
|
|
17263
|
-
// node_modules/vitest/dist/index.js
|
|
17731
|
+
// ../../node_modules/vitest/dist/index.js
|
|
17264
17732
|
var import_expect_type2 = __toESM(require_dist(), 1);
|
|
17265
17733
|
|
|
17266
17734
|
// src/testing/index.ts
|
|
@@ -17334,27 +17802,45 @@ export {
|
|
|
17334
17802
|
};
|
|
17335
17803
|
/*! Bundled license information:
|
|
17336
17804
|
|
|
17337
|
-
vitest/dist/chunks/index.
|
|
17805
|
+
vitest/dist/chunks/index.D0heQG4v.js:
|
|
17338
17806
|
(**
|
|
17339
|
-
|
|
17340
|
-
|
|
17341
|
-
|
|
17342
|
-
|
|
17343
|
-
|
|
17344
|
-
|
|
17345
|
-
|
|
17346
|
-
|
|
17807
|
+
* @license React
|
|
17808
|
+
* react-is.production.js
|
|
17809
|
+
*
|
|
17810
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
17811
|
+
*
|
|
17812
|
+
* This source code is licensed under the MIT license found in the
|
|
17813
|
+
* LICENSE file in the root directory of this source tree.
|
|
17814
|
+
*)
|
|
17347
17815
|
(**
|
|
17348
|
-
|
|
17349
|
-
|
|
17350
|
-
|
|
17351
|
-
|
|
17352
|
-
|
|
17353
|
-
|
|
17354
|
-
|
|
17355
|
-
|
|
17816
|
+
* @license React
|
|
17817
|
+
* react-is.development.js
|
|
17818
|
+
*
|
|
17819
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
17820
|
+
*
|
|
17821
|
+
* This source code is licensed under the MIT license found in the
|
|
17822
|
+
* LICENSE file in the root directory of this source tree.
|
|
17823
|
+
*)
|
|
17824
|
+
(**
|
|
17825
|
+
* @license React
|
|
17826
|
+
* react-is.production.min.js
|
|
17827
|
+
*
|
|
17828
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17829
|
+
*
|
|
17830
|
+
* This source code is licensed under the MIT license found in the
|
|
17831
|
+
* LICENSE file in the root directory of this source tree.
|
|
17832
|
+
*)
|
|
17833
|
+
(**
|
|
17834
|
+
* @license React
|
|
17835
|
+
* react-is.development.js
|
|
17836
|
+
*
|
|
17837
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
17838
|
+
*
|
|
17839
|
+
* This source code is licensed under the MIT license found in the
|
|
17840
|
+
* LICENSE file in the root directory of this source tree.
|
|
17841
|
+
*)
|
|
17356
17842
|
|
|
17357
|
-
vitest/dist/chunks/index.
|
|
17843
|
+
vitest/dist/chunks/index.aTZaPVhf.js:
|
|
17358
17844
|
(*
|
|
17359
17845
|
* @version 1.4.0
|
|
17360
17846
|
* @date 2015-10-26
|