@ggui-ai/ui-gen 0.13.0 → 0.15.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/dist/adapters/generation-dispatch.d.ts +2 -2
- package/dist/adapters/generation-dispatch.js +192 -58
- package/dist/adapters/generation-dispatch.js.map +1 -1
- package/dist/adapters/index.js +7 -9
- package/dist/adapters/index.js.map +1 -1
- package/dist/advanced/index.d.ts +3 -3
- package/dist/advanced/index.js +192 -58
- package/dist/advanced/index.js.map +1 -1
- package/dist/blueprint-validator.js +2 -7
- package/dist/blueprint-validator.js.map +1 -1
- package/dist/boilerplate.js +4 -4
- package/dist/boilerplate.js.map +1 -1
- package/dist/check/index.d.ts +1 -1
- package/dist/check/index.js +57 -16
- package/dist/check/index.js.map +1 -1
- package/dist/{create-ui-generator-CF0EL0Li.d.ts → create-ui-generator-D6TKuv9V.d.ts} +2 -2
- package/dist/{dispatch-D75M-OfZ.d.ts → dispatch-BuZfTh9r.d.ts} +1 -1
- package/dist/evaluation/axis-checks/index.d.ts +3 -3
- package/dist/evaluation/axis-checks/index.js.map +1 -1
- package/dist/evaluation/axis-checks/registry.d.ts +1 -1
- package/dist/evaluation/index.d.ts +3 -3
- package/dist/evaluation/index.js +79 -16
- package/dist/evaluation/index.js.map +1 -1
- package/dist/harness/check/runtime-render/index.d.ts +1 -1
- package/dist/harness/check/runtime-render/index.js +2 -7
- package/dist/harness/check/runtime-render/index.js.map +1 -1
- package/dist/harness/index.d.ts +2 -2
- package/dist/harness/index.js +64 -19
- package/dist/harness/index.js.map +1 -1
- package/dist/harness/prompts.js +2 -0
- package/dist/harness/prompts.js.map +1 -1
- package/dist/harness/result-types.d.ts +1 -1
- package/dist/harness/runtime.d.ts +2 -2
- package/dist/harness/runtime.js +5 -5
- package/dist/harness/runtime.js.map +1 -1
- package/dist/harness/types-public.d.ts +1 -1
- package/dist/harness/types-public.js +4 -4
- package/dist/harness/types-public.js.map +1 -1
- package/dist/harness/validator-trace-sink.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +192 -58
- package/dist/index.js.map +1 -1
- package/dist/{llm-router-BEVtbAb9.d.ts → llm-router-D7fjBhtr.d.ts} +39 -0
- package/dist/patch.d.ts +1 -1
- package/dist/provider-adapter-contract.js +1017 -731
- package/dist/provider-adapter-contract.js.map +1 -1
- package/dist/{types-public-DIpjC-OA.d.ts → types-public-CkNWEov9.d.ts} +64 -1
- package/dist/validation/index.d.ts +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/index.js.map +1 -1
- package/dist/workflows.d.ts +1 -1
- package/package.json +21 -21
- package/src/adapters/provider-router.ts +9 -0
- package/src/boilerplate/system-prompt.ts +4 -4
- package/src/check/run-tier0.ts +109 -22
- package/src/check/type-checker.ts +12 -2
- package/src/evaluation/index.ts +4 -0
- package/src/evaluation/llm-evaluator.ts +52 -8
- package/src/evaluation/types-public.ts +79 -0
- package/src/evaluation/visual-evaluator.ts +27 -5
- package/src/harness/coding/run-eval-round.ts +32 -6
- package/src/harness/llm-router.ts +128 -2
- package/src/validation/primitives.ts +1 -1
|
@@ -6,20 +6,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __esm = (fn2, res
|
|
10
|
-
|
|
11
|
-
try {
|
|
12
|
-
return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
|
|
13
|
-
} catch (e) {
|
|
14
|
-
throw err = [e], e;
|
|
15
|
-
}
|
|
9
|
+
var __esm = (fn2, res) => function __init() {
|
|
10
|
+
return fn2 && (res = (0, fn2[__getOwnPropNames(fn2)[0]])(fn2 = 0)), res;
|
|
16
11
|
};
|
|
17
12
|
var __commonJS = (cb, mod) => function __require() {
|
|
18
|
-
|
|
19
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
20
|
-
} catch (e) {
|
|
21
|
-
throw mod = 0, e;
|
|
22
|
-
}
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
23
14
|
};
|
|
24
15
|
var __export = (target, all) => {
|
|
25
16
|
for (var name in all)
|
|
@@ -596,7 +587,7 @@ function getRelativePath(from, to) {
|
|
|
596
587
|
}
|
|
597
588
|
return fromParts.concat(toParts).join("/");
|
|
598
589
|
}
|
|
599
|
-
function
|
|
590
|
+
function isObject4(thing) {
|
|
600
591
|
return toString4.call(thing) === "[object Object]";
|
|
601
592
|
}
|
|
602
593
|
function getLocator(source) {
|
|
@@ -610,11 +601,11 @@ function getLocator(source) {
|
|
|
610
601
|
let i = 0;
|
|
611
602
|
let j2 = lineOffsets.length;
|
|
612
603
|
while (i < j2) {
|
|
613
|
-
const
|
|
614
|
-
if (index2 < lineOffsets[
|
|
615
|
-
j2 =
|
|
604
|
+
const m2 = i + j2 >> 1;
|
|
605
|
+
if (index2 < lineOffsets[m2]) {
|
|
606
|
+
j2 = m2;
|
|
616
607
|
} else {
|
|
617
|
-
i =
|
|
608
|
+
i = m2 + 1;
|
|
618
609
|
}
|
|
619
610
|
}
|
|
620
611
|
const line = i - 1;
|
|
@@ -1027,7 +1018,7 @@ var init_magic_string_es = __esm({
|
|
|
1027
1018
|
}
|
|
1028
1019
|
indent(indentStr, options) {
|
|
1029
1020
|
const pattern = /^[^\r\n]/gm;
|
|
1030
|
-
if (
|
|
1021
|
+
if (isObject4(indentStr)) {
|
|
1031
1022
|
options = indentStr;
|
|
1032
1023
|
indentStr = void 0;
|
|
1033
1024
|
}
|
|
@@ -1347,10 +1338,10 @@ var init_magic_string_es = __esm({
|
|
|
1347
1338
|
}
|
|
1348
1339
|
// TODO deprecate this? not really very useful
|
|
1349
1340
|
snip(start, end) {
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
return
|
|
1341
|
+
const clone4 = this.clone();
|
|
1342
|
+
clone4.remove(0, start);
|
|
1343
|
+
clone4.remove(end, clone4.original.length);
|
|
1344
|
+
return clone4;
|
|
1354
1345
|
}
|
|
1355
1346
|
_split(index2) {
|
|
1356
1347
|
if (this.byStart[index2] || this.byEnd[index2]) return;
|
|
@@ -1565,7 +1556,7 @@ var init_magic_string_es = __esm({
|
|
|
1565
1556
|
separator: this.separator
|
|
1566
1557
|
});
|
|
1567
1558
|
}
|
|
1568
|
-
if (!
|
|
1559
|
+
if (!isObject4(source) || !source.content) {
|
|
1569
1560
|
throw new Error(
|
|
1570
1561
|
"bundle.addSource() takes an object with a `content` property, which should be an instance of MagicString, and an optional `filename`"
|
|
1571
1562
|
);
|
|
@@ -1692,8 +1683,8 @@ var init_magic_string_es = __esm({
|
|
|
1692
1683
|
if (!indentStringCounts[indentStr]) indentStringCounts[indentStr] = 0;
|
|
1693
1684
|
indentStringCounts[indentStr] += 1;
|
|
1694
1685
|
});
|
|
1695
|
-
return Object.keys(indentStringCounts).sort((
|
|
1696
|
-
return indentStringCounts[
|
|
1686
|
+
return Object.keys(indentStringCounts).sort((a3, b2) => {
|
|
1687
|
+
return indentStringCounts[a3] - indentStringCounts[b2];
|
|
1697
1688
|
})[0] || " ";
|
|
1698
1689
|
}
|
|
1699
1690
|
indent(indentStr) {
|
|
@@ -1811,21 +1802,21 @@ var require_utils = __commonJS({
|
|
|
1811
1802
|
// ../../node_modules/expect-type/dist/index.js
|
|
1812
1803
|
var require_dist = __commonJS({
|
|
1813
1804
|
"../../node_modules/expect-type/dist/index.js"(exports) {
|
|
1814
|
-
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o,
|
|
1805
|
+
var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o, m2, k2, k22) {
|
|
1815
1806
|
if (k22 === void 0) k22 = k2;
|
|
1816
|
-
var desc = Object.getOwnPropertyDescriptor(
|
|
1817
|
-
if (!desc || ("get" in desc ? !
|
|
1807
|
+
var desc = Object.getOwnPropertyDescriptor(m2, k2);
|
|
1808
|
+
if (!desc || ("get" in desc ? !m2.__esModule : desc.writable || desc.configurable)) {
|
|
1818
1809
|
desc = { enumerable: true, get: function() {
|
|
1819
|
-
return
|
|
1810
|
+
return m2[k2];
|
|
1820
1811
|
} };
|
|
1821
1812
|
}
|
|
1822
1813
|
Object.defineProperty(o, k22, desc);
|
|
1823
|
-
}) : (function(o,
|
|
1814
|
+
}) : (function(o, m2, k2, k22) {
|
|
1824
1815
|
if (k22 === void 0) k22 = k2;
|
|
1825
|
-
o[k22] =
|
|
1816
|
+
o[k22] = m2[k2];
|
|
1826
1817
|
}));
|
|
1827
|
-
var __exportStar = exports && exports.__exportStar || function(
|
|
1828
|
-
for (var
|
|
1818
|
+
var __exportStar = exports && exports.__exportStar || function(m2, exports2) {
|
|
1819
|
+
for (var p3 in m2) if (p3 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p3)) __createBinding(exports2, m2, p3);
|
|
1829
1820
|
};
|
|
1830
1821
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1831
1822
|
exports.expectTypeOf = void 0;
|
|
@@ -1895,7 +1886,7 @@ var require_dist = __commonJS({
|
|
|
1895
1886
|
}
|
|
1896
1887
|
});
|
|
1897
1888
|
|
|
1898
|
-
// ../../node_modules
|
|
1889
|
+
// ../../node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
|
|
1899
1890
|
var f = {
|
|
1900
1891
|
reset: [0, 0],
|
|
1901
1892
|
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
@@ -1950,35 +1941,35 @@ function C(n2 = false) {
|
|
|
1950
1941
|
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n2 && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
|
|
1951
1942
|
}
|
|
1952
1943
|
function p(n2 = false) {
|
|
1953
|
-
let e = C(n2), i = (
|
|
1954
|
-
let l2 = "",
|
|
1944
|
+
let e = C(n2), i = (r2, t, c, o) => {
|
|
1945
|
+
let l2 = "", s2 = 0;
|
|
1955
1946
|
do
|
|
1956
|
-
l2 +=
|
|
1947
|
+
l2 += r2.substring(s2, o) + c, s2 = o + t.length, o = r2.indexOf(t, s2);
|
|
1957
1948
|
while (~o);
|
|
1958
|
-
return l2 +
|
|
1959
|
-
}, g = (
|
|
1949
|
+
return l2 + r2.substring(s2);
|
|
1950
|
+
}, g = (r2, t, c = r2) => {
|
|
1960
1951
|
let o = (l2) => {
|
|
1961
|
-
let
|
|
1962
|
-
return ~b2 ?
|
|
1952
|
+
let s2 = String(l2), b2 = s2.indexOf(t, r2.length);
|
|
1953
|
+
return ~b2 ? r2 + i(s2, t, c, b2) + t : r2 + s2 + t;
|
|
1963
1954
|
};
|
|
1964
|
-
return o.open =
|
|
1965
|
-
},
|
|
1955
|
+
return o.open = r2, o.close = t, o;
|
|
1956
|
+
}, u3 = {
|
|
1966
1957
|
isColorSupported: e
|
|
1967
|
-
}, d = (
|
|
1968
|
-
for (let [
|
|
1969
|
-
|
|
1958
|
+
}, d = (r2) => `\x1B[${r2}m`;
|
|
1959
|
+
for (let [r2, t] of h)
|
|
1960
|
+
u3[r2] = e ? g(
|
|
1970
1961
|
d(t[0]),
|
|
1971
1962
|
d(t[1]),
|
|
1972
1963
|
t[2]
|
|
1973
1964
|
) : a;
|
|
1974
|
-
return
|
|
1965
|
+
return u3;
|
|
1975
1966
|
}
|
|
1976
1967
|
var r = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
1977
1968
|
var u = p(r);
|
|
1978
1969
|
|
|
1979
1970
|
// ../../node_modules/@vitest/pretty-format/dist/index.js
|
|
1980
|
-
function _mergeNamespaces$1(n2,
|
|
1981
|
-
|
|
1971
|
+
function _mergeNamespaces$1(n2, m2) {
|
|
1972
|
+
m2.forEach(function(e) {
|
|
1982
1973
|
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k2) {
|
|
1983
1974
|
if (k2 !== "default" && !(k2 in n2)) {
|
|
1984
1975
|
var d = Object.getOwnPropertyDescriptor(e, k2);
|
|
@@ -2534,49 +2525,49 @@ var hasRequiredReactIs_production_min;
|
|
|
2534
2525
|
function requireReactIs_production_min() {
|
|
2535
2526
|
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
2536
2527
|
hasRequiredReactIs_production_min = 1;
|
|
2537
|
-
var b2 = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"),
|
|
2538
|
-
|
|
2539
|
-
function v2(
|
|
2540
|
-
if ("object" === typeof
|
|
2541
|
-
var
|
|
2542
|
-
switch (
|
|
2528
|
+
var b2 = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f4 = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h4 = /* @__PURE__ */ Symbol.for("react.context"), k2 = /* @__PURE__ */ Symbol.for("react.server_context"), l2 = /* @__PURE__ */ Symbol.for("react.forward_ref"), m2 = /* @__PURE__ */ Symbol.for("react.suspense"), n2 = /* @__PURE__ */ Symbol.for("react.suspense_list"), p3 = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t = /* @__PURE__ */ Symbol.for("react.offscreen"), u3;
|
|
2529
|
+
u3 = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
2530
|
+
function v2(a3) {
|
|
2531
|
+
if ("object" === typeof a3 && null !== a3) {
|
|
2532
|
+
var r2 = a3.$$typeof;
|
|
2533
|
+
switch (r2) {
|
|
2543
2534
|
case b2:
|
|
2544
|
-
switch (
|
|
2535
|
+
switch (a3 = a3.type, a3) {
|
|
2545
2536
|
case d:
|
|
2546
|
-
case
|
|
2537
|
+
case f4:
|
|
2547
2538
|
case e:
|
|
2548
|
-
case
|
|
2539
|
+
case m2:
|
|
2549
2540
|
case n2:
|
|
2550
|
-
return
|
|
2541
|
+
return a3;
|
|
2551
2542
|
default:
|
|
2552
|
-
switch (
|
|
2543
|
+
switch (a3 = a3 && a3.$$typeof, a3) {
|
|
2553
2544
|
case k2:
|
|
2554
|
-
case
|
|
2545
|
+
case h4:
|
|
2555
2546
|
case l2:
|
|
2556
2547
|
case q:
|
|
2557
|
-
case
|
|
2548
|
+
case p3:
|
|
2558
2549
|
case g:
|
|
2559
|
-
return
|
|
2550
|
+
return a3;
|
|
2560
2551
|
default:
|
|
2561
|
-
return
|
|
2552
|
+
return r2;
|
|
2562
2553
|
}
|
|
2563
2554
|
}
|
|
2564
2555
|
case c:
|
|
2565
|
-
return
|
|
2556
|
+
return r2;
|
|
2566
2557
|
}
|
|
2567
2558
|
}
|
|
2568
2559
|
}
|
|
2569
|
-
reactIs_production_min.ContextConsumer =
|
|
2560
|
+
reactIs_production_min.ContextConsumer = h4;
|
|
2570
2561
|
reactIs_production_min.ContextProvider = g;
|
|
2571
2562
|
reactIs_production_min.Element = b2;
|
|
2572
2563
|
reactIs_production_min.ForwardRef = l2;
|
|
2573
2564
|
reactIs_production_min.Fragment = d;
|
|
2574
2565
|
reactIs_production_min.Lazy = q;
|
|
2575
|
-
reactIs_production_min.Memo =
|
|
2566
|
+
reactIs_production_min.Memo = p3;
|
|
2576
2567
|
reactIs_production_min.Portal = c;
|
|
2577
|
-
reactIs_production_min.Profiler =
|
|
2568
|
+
reactIs_production_min.Profiler = f4;
|
|
2578
2569
|
reactIs_production_min.StrictMode = e;
|
|
2579
|
-
reactIs_production_min.Suspense =
|
|
2570
|
+
reactIs_production_min.Suspense = m2;
|
|
2580
2571
|
reactIs_production_min.SuspenseList = n2;
|
|
2581
2572
|
reactIs_production_min.isAsyncMode = function() {
|
|
2582
2573
|
return false;
|
|
@@ -2584,44 +2575,44 @@ function requireReactIs_production_min() {
|
|
|
2584
2575
|
reactIs_production_min.isConcurrentMode = function() {
|
|
2585
2576
|
return false;
|
|
2586
2577
|
};
|
|
2587
|
-
reactIs_production_min.isContextConsumer = function(
|
|
2588
|
-
return v2(
|
|
2578
|
+
reactIs_production_min.isContextConsumer = function(a3) {
|
|
2579
|
+
return v2(a3) === h4;
|
|
2589
2580
|
};
|
|
2590
|
-
reactIs_production_min.isContextProvider = function(
|
|
2591
|
-
return v2(
|
|
2581
|
+
reactIs_production_min.isContextProvider = function(a3) {
|
|
2582
|
+
return v2(a3) === g;
|
|
2592
2583
|
};
|
|
2593
|
-
reactIs_production_min.isElement = function(
|
|
2594
|
-
return "object" === typeof
|
|
2584
|
+
reactIs_production_min.isElement = function(a3) {
|
|
2585
|
+
return "object" === typeof a3 && null !== a3 && a3.$$typeof === b2;
|
|
2595
2586
|
};
|
|
2596
|
-
reactIs_production_min.isForwardRef = function(
|
|
2597
|
-
return v2(
|
|
2587
|
+
reactIs_production_min.isForwardRef = function(a3) {
|
|
2588
|
+
return v2(a3) === l2;
|
|
2598
2589
|
};
|
|
2599
|
-
reactIs_production_min.isFragment = function(
|
|
2600
|
-
return v2(
|
|
2590
|
+
reactIs_production_min.isFragment = function(a3) {
|
|
2591
|
+
return v2(a3) === d;
|
|
2601
2592
|
};
|
|
2602
|
-
reactIs_production_min.isLazy = function(
|
|
2603
|
-
return v2(
|
|
2593
|
+
reactIs_production_min.isLazy = function(a3) {
|
|
2594
|
+
return v2(a3) === q;
|
|
2604
2595
|
};
|
|
2605
|
-
reactIs_production_min.isMemo = function(
|
|
2606
|
-
return v2(
|
|
2596
|
+
reactIs_production_min.isMemo = function(a3) {
|
|
2597
|
+
return v2(a3) === p3;
|
|
2607
2598
|
};
|
|
2608
|
-
reactIs_production_min.isPortal = function(
|
|
2609
|
-
return v2(
|
|
2599
|
+
reactIs_production_min.isPortal = function(a3) {
|
|
2600
|
+
return v2(a3) === c;
|
|
2610
2601
|
};
|
|
2611
|
-
reactIs_production_min.isProfiler = function(
|
|
2612
|
-
return v2(
|
|
2602
|
+
reactIs_production_min.isProfiler = function(a3) {
|
|
2603
|
+
return v2(a3) === f4;
|
|
2613
2604
|
};
|
|
2614
|
-
reactIs_production_min.isStrictMode = function(
|
|
2615
|
-
return v2(
|
|
2605
|
+
reactIs_production_min.isStrictMode = function(a3) {
|
|
2606
|
+
return v2(a3) === e;
|
|
2616
2607
|
};
|
|
2617
|
-
reactIs_production_min.isSuspense = function(
|
|
2618
|
-
return v2(
|
|
2608
|
+
reactIs_production_min.isSuspense = function(a3) {
|
|
2609
|
+
return v2(a3) === m2;
|
|
2619
2610
|
};
|
|
2620
|
-
reactIs_production_min.isSuspenseList = function(
|
|
2621
|
-
return v2(
|
|
2611
|
+
reactIs_production_min.isSuspenseList = function(a3) {
|
|
2612
|
+
return v2(a3) === n2;
|
|
2622
2613
|
};
|
|
2623
|
-
reactIs_production_min.isValidElementType = function(
|
|
2624
|
-
return "string" === typeof
|
|
2614
|
+
reactIs_production_min.isValidElementType = function(a3) {
|
|
2615
|
+
return "string" === typeof a3 || "function" === typeof a3 || a3 === d || a3 === f4 || a3 === e || a3 === m2 || a3 === n2 || a3 === t || "object" === typeof a3 && null !== a3 && (a3.$$typeof === q || a3.$$typeof === p3 || a3.$$typeof === g || a3.$$typeof === h4 || a3.$$typeof === l2 || a3.$$typeof === u3 || void 0 !== a3.getModuleId) ? true : false;
|
|
2625
2616
|
};
|
|
2626
2617
|
reactIs_production_min.typeOf = v2;
|
|
2627
2618
|
return reactIs_production_min;
|
|
@@ -2841,7 +2832,7 @@ var reactIsMethods = [
|
|
|
2841
2832
|
"isSuspenseList",
|
|
2842
2833
|
"isValidElementType"
|
|
2843
2834
|
];
|
|
2844
|
-
var ReactIs = Object.fromEntries(reactIsMethods.map((
|
|
2835
|
+
var ReactIs = Object.fromEntries(reactIsMethods.map((m2) => [m2, (v2) => ReactIs18[m2](v2) || ReactIs19[m2](v2)]));
|
|
2845
2836
|
function getChildren(arg, children = []) {
|
|
2846
2837
|
if (Array.isArray(arg)) {
|
|
2847
2838
|
for (const item of arg) {
|
|
@@ -3764,7 +3755,7 @@ function inspect(value, opts = {}) {
|
|
|
3764
3755
|
return options.stylize(String(value), type3);
|
|
3765
3756
|
}
|
|
3766
3757
|
|
|
3767
|
-
// ../../node_modules
|
|
3758
|
+
// ../../node_modules/@vitest/expect/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.js
|
|
3768
3759
|
var { AsymmetricMatcher, DOMCollection, DOMElement, Immutable, ReactElement, ReactTestComponent } = plugins;
|
|
3769
3760
|
var PLUGINS = [
|
|
3770
3761
|
ReactTestComponent,
|
|
@@ -3871,8 +3862,8 @@ function format2(...args) {
|
|
|
3871
3862
|
try {
|
|
3872
3863
|
return JSON.stringify(args[i++]);
|
|
3873
3864
|
} catch (err) {
|
|
3874
|
-
const
|
|
3875
|
-
if (
|
|
3865
|
+
const m2 = err.message;
|
|
3866
|
+
if (m2.includes("circular structure") || m2.includes("cyclic structures") || m2.includes("cyclic object")) {
|
|
3876
3867
|
return "[Circular]";
|
|
3877
3868
|
}
|
|
3878
3869
|
throw err;
|
|
@@ -3900,19 +3891,7 @@ function getDefaultExportFromCjs2(x2) {
|
|
|
3900
3891
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
3901
3892
|
}
|
|
3902
3893
|
|
|
3903
|
-
// ../../node_modules
|
|
3904
|
-
function createSimpleStackTrace(options) {
|
|
3905
|
-
const { message = "$$stack trace error", stackTraceLimit = 1 } = options || {};
|
|
3906
|
-
const limit = Error.stackTraceLimit;
|
|
3907
|
-
const prepareStackTrace = Error.prepareStackTrace;
|
|
3908
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
3909
|
-
Error.prepareStackTrace = (e) => e.stack;
|
|
3910
|
-
const err = new Error(message);
|
|
3911
|
-
const stackTrace = err.stack || "";
|
|
3912
|
-
Error.prepareStackTrace = prepareStackTrace;
|
|
3913
|
-
Error.stackTraceLimit = limit;
|
|
3914
|
-
return stackTrace;
|
|
3915
|
-
}
|
|
3894
|
+
// ../../node_modules/@vitest/expect/node_modules/@vitest/utils/dist/helpers.js
|
|
3916
3895
|
function assertTypes(value, name, types) {
|
|
3917
3896
|
const receivedType = typeof value;
|
|
3918
3897
|
const pass = types.includes(receivedType);
|
|
@@ -3998,88 +3977,7 @@ function clone(val, seen, options = defaultCloneOptions) {
|
|
|
3998
3977
|
function noop() {
|
|
3999
3978
|
}
|
|
4000
3979
|
|
|
4001
|
-
// ../../node_modules
|
|
4002
|
-
var f2 = {
|
|
4003
|
-
reset: [0, 0],
|
|
4004
|
-
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
4005
|
-
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
4006
|
-
italic: [3, 23],
|
|
4007
|
-
underline: [4, 24],
|
|
4008
|
-
inverse: [7, 27],
|
|
4009
|
-
hidden: [8, 28],
|
|
4010
|
-
strikethrough: [9, 29],
|
|
4011
|
-
black: [30, 39],
|
|
4012
|
-
red: [31, 39],
|
|
4013
|
-
green: [32, 39],
|
|
4014
|
-
yellow: [33, 39],
|
|
4015
|
-
blue: [34, 39],
|
|
4016
|
-
magenta: [35, 39],
|
|
4017
|
-
cyan: [36, 39],
|
|
4018
|
-
white: [37, 39],
|
|
4019
|
-
gray: [90, 39],
|
|
4020
|
-
bgBlack: [40, 49],
|
|
4021
|
-
bgRed: [41, 49],
|
|
4022
|
-
bgGreen: [42, 49],
|
|
4023
|
-
bgYellow: [43, 49],
|
|
4024
|
-
bgBlue: [44, 49],
|
|
4025
|
-
bgMagenta: [45, 49],
|
|
4026
|
-
bgCyan: [46, 49],
|
|
4027
|
-
bgWhite: [47, 49],
|
|
4028
|
-
blackBright: [90, 39],
|
|
4029
|
-
redBright: [91, 39],
|
|
4030
|
-
greenBright: [92, 39],
|
|
4031
|
-
yellowBright: [93, 39],
|
|
4032
|
-
blueBright: [94, 39],
|
|
4033
|
-
magentaBright: [95, 39],
|
|
4034
|
-
cyanBright: [96, 39],
|
|
4035
|
-
whiteBright: [97, 39],
|
|
4036
|
-
bgBlackBright: [100, 49],
|
|
4037
|
-
bgRedBright: [101, 49],
|
|
4038
|
-
bgGreenBright: [102, 49],
|
|
4039
|
-
bgYellowBright: [103, 49],
|
|
4040
|
-
bgBlueBright: [104, 49],
|
|
4041
|
-
bgMagentaBright: [105, 49],
|
|
4042
|
-
bgCyanBright: [106, 49],
|
|
4043
|
-
bgWhiteBright: [107, 49]
|
|
4044
|
-
};
|
|
4045
|
-
var h2 = Object.entries(f2);
|
|
4046
|
-
function a2(n2) {
|
|
4047
|
-
return String(n2);
|
|
4048
|
-
}
|
|
4049
|
-
a2.open = "";
|
|
4050
|
-
a2.close = "";
|
|
4051
|
-
function C2(n2 = false) {
|
|
4052
|
-
let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
|
|
4053
|
-
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n2 && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
|
|
4054
|
-
}
|
|
4055
|
-
function p2(n2 = false) {
|
|
4056
|
-
let e = C2(n2), i = (r4, t, c, o) => {
|
|
4057
|
-
let l2 = "", s4 = 0;
|
|
4058
|
-
do
|
|
4059
|
-
l2 += r4.substring(s4, o) + c, s4 = o + t.length, o = r4.indexOf(t, s4);
|
|
4060
|
-
while (~o);
|
|
4061
|
-
return l2 + r4.substring(s4);
|
|
4062
|
-
}, g = (r4, t, c = r4) => {
|
|
4063
|
-
let o = (l2) => {
|
|
4064
|
-
let s4 = String(l2), b2 = s4.indexOf(t, r4.length);
|
|
4065
|
-
return ~b2 ? r4 + i(s4, t, c, b2) + t : r4 + s4 + t;
|
|
4066
|
-
};
|
|
4067
|
-
return o.open = r4, o.close = t, o;
|
|
4068
|
-
}, u5 = {
|
|
4069
|
-
isColorSupported: e
|
|
4070
|
-
}, d = (r4) => `\x1B[${r4}m`;
|
|
4071
|
-
for (let [r4, t] of h2)
|
|
4072
|
-
u5[r4] = e ? g(
|
|
4073
|
-
d(t[0]),
|
|
4074
|
-
d(t[1]),
|
|
4075
|
-
t[2]
|
|
4076
|
-
) : a2;
|
|
4077
|
-
return u5;
|
|
4078
|
-
}
|
|
4079
|
-
var r2 = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
4080
|
-
var u2 = p2(r2);
|
|
4081
|
-
|
|
4082
|
-
// ../../node_modules/vitest/node_modules/@vitest/utils/dist/index.js
|
|
3980
|
+
// ../../node_modules/@vitest/expect/node_modules/@vitest/utils/dist/index.js
|
|
4083
3981
|
var jsTokens_1;
|
|
4084
3982
|
var hasRequiredJsTokens;
|
|
4085
3983
|
function requireJsTokens() {
|
|
@@ -4526,23 +4424,8 @@ var reservedWords = {
|
|
|
4526
4424
|
};
|
|
4527
4425
|
new Set(reservedWords.keyword);
|
|
4528
4426
|
new Set(reservedWords.strict);
|
|
4529
|
-
var SAFE_TIMERS_SYMBOL = /* @__PURE__ */ Symbol("vitest:SAFE_TIMERS");
|
|
4530
|
-
function getSafeTimers() {
|
|
4531
|
-
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
4532
|
-
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || { nextTick: (cb) => cb() };
|
|
4533
|
-
return {
|
|
4534
|
-
nextTick: safeNextTick,
|
|
4535
|
-
setTimeout: safeSetTimeout,
|
|
4536
|
-
setInterval: safeSetInterval,
|
|
4537
|
-
clearInterval: safeClearInterval,
|
|
4538
|
-
clearTimeout: safeClearTimeout,
|
|
4539
|
-
setImmediate: safeSetImmediate,
|
|
4540
|
-
clearImmediate: safeClearImmediate,
|
|
4541
|
-
queueMicrotask: safeQueueMicrotask
|
|
4542
|
-
};
|
|
4543
|
-
}
|
|
4544
4427
|
|
|
4545
|
-
// ../../node_modules
|
|
4428
|
+
// ../../node_modules/@vitest/expect/node_modules/@vitest/utils/dist/diff.js
|
|
4546
4429
|
var DIFF_DELETE = -1;
|
|
4547
4430
|
var DIFF_INSERT = 1;
|
|
4548
4431
|
var DIFF_EQUAL = 0;
|
|
@@ -5520,14 +5403,14 @@ var DIFF_TRUNCATE_THRESHOLD_DEFAULT = 0;
|
|
|
5520
5403
|
function getDefaultOptions() {
|
|
5521
5404
|
return {
|
|
5522
5405
|
aAnnotation: "Expected",
|
|
5523
|
-
aColor:
|
|
5406
|
+
aColor: u.green,
|
|
5524
5407
|
aIndicator: "-",
|
|
5525
5408
|
bAnnotation: "Received",
|
|
5526
|
-
bColor:
|
|
5409
|
+
bColor: u.red,
|
|
5527
5410
|
bIndicator: "+",
|
|
5528
|
-
changeColor:
|
|
5411
|
+
changeColor: u.inverse,
|
|
5529
5412
|
changeLineTrailingSpaceColor: noColor,
|
|
5530
|
-
commonColor:
|
|
5413
|
+
commonColor: u.dim,
|
|
5531
5414
|
commonIndicator: " ",
|
|
5532
5415
|
commonLineTrailingSpaceColor: noColor,
|
|
5533
5416
|
compareKeys: void 0,
|
|
@@ -5536,7 +5419,7 @@ function getDefaultOptions() {
|
|
|
5536
5419
|
expand: false,
|
|
5537
5420
|
includeChangeCounts: false,
|
|
5538
5421
|
omitAnnotationLines: false,
|
|
5539
|
-
patchColor:
|
|
5422
|
+
patchColor: u.yellow,
|
|
5540
5423
|
printBasicPrototype: false,
|
|
5541
5424
|
truncateThreshold: DIFF_TRUNCATE_THRESHOLD_DEFAULT,
|
|
5542
5425
|
truncateAnnotation: "... Diff result is truncated",
|
|
@@ -5561,12 +5444,12 @@ function isEmptyString(lines) {
|
|
|
5561
5444
|
return lines.length === 1 && lines[0].length === 0;
|
|
5562
5445
|
}
|
|
5563
5446
|
function countChanges(diffs) {
|
|
5564
|
-
let
|
|
5447
|
+
let a3 = 0;
|
|
5565
5448
|
let b2 = 0;
|
|
5566
5449
|
diffs.forEach((diff2) => {
|
|
5567
5450
|
switch (diff2[0]) {
|
|
5568
5451
|
case DIFF_DELETE:
|
|
5569
|
-
|
|
5452
|
+
a3 += 1;
|
|
5570
5453
|
break;
|
|
5571
5454
|
case DIFF_INSERT:
|
|
5572
5455
|
b2 += 1;
|
|
@@ -5574,7 +5457,7 @@ function countChanges(diffs) {
|
|
|
5574
5457
|
}
|
|
5575
5458
|
});
|
|
5576
5459
|
return {
|
|
5577
|
-
a:
|
|
5460
|
+
a: a3,
|
|
5578
5461
|
b: b2
|
|
5579
5462
|
};
|
|
5580
5463
|
}
|
|
@@ -5596,9 +5479,9 @@ function printAnnotation({ aAnnotation, aColor, aIndicator, bAnnotation, bColor,
|
|
|
5596
5479
|
aRest = `${aAnnotationPadding} ${aIndicator} ${aCountPadding}${aCount}`;
|
|
5597
5480
|
bRest = `${bAnnotationPadding} ${bIndicator} ${bCountPadding}${bCount}`;
|
|
5598
5481
|
}
|
|
5599
|
-
const
|
|
5482
|
+
const a3 = `${aIndicator} ${aAnnotation}${aRest}`;
|
|
5600
5483
|
const b2 = `${bIndicator} ${bAnnotation}${bRest}`;
|
|
5601
|
-
return `${aColor(
|
|
5484
|
+
return `${aColor(a3)}
|
|
5602
5485
|
${bColor(b2)}
|
|
5603
5486
|
|
|
5604
5487
|
`;
|
|
@@ -5713,31 +5596,31 @@ function getType3(value) {
|
|
|
5713
5596
|
function getNewLineSymbol(string2) {
|
|
5714
5597
|
return string2.includes("\r\n") ? "\r\n" : "\n";
|
|
5715
5598
|
}
|
|
5716
|
-
function diffStrings(
|
|
5599
|
+
function diffStrings(a3, b2, options) {
|
|
5717
5600
|
const truncate3 = (options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? false;
|
|
5718
5601
|
const truncateThreshold = Math.max(Math.floor((options === null || options === void 0 ? void 0 : options.truncateThreshold) ?? 0), 0);
|
|
5719
|
-
let aLength =
|
|
5602
|
+
let aLength = a3.length;
|
|
5720
5603
|
let bLength = b2.length;
|
|
5721
5604
|
if (truncate3) {
|
|
5722
|
-
const aMultipleLines =
|
|
5605
|
+
const aMultipleLines = a3.includes("\n");
|
|
5723
5606
|
const bMultipleLines = b2.includes("\n");
|
|
5724
|
-
const aNewLineSymbol = getNewLineSymbol(
|
|
5607
|
+
const aNewLineSymbol = getNewLineSymbol(a3);
|
|
5725
5608
|
const bNewLineSymbol = getNewLineSymbol(b2);
|
|
5726
|
-
const _a = aMultipleLines ? `${
|
|
5727
|
-
` :
|
|
5609
|
+
const _a = aMultipleLines ? `${a3.split(aNewLineSymbol, truncateThreshold).join(aNewLineSymbol)}
|
|
5610
|
+
` : a3;
|
|
5728
5611
|
const _b = bMultipleLines ? `${b2.split(bNewLineSymbol, truncateThreshold).join(bNewLineSymbol)}
|
|
5729
5612
|
` : b2;
|
|
5730
5613
|
aLength = _a.length;
|
|
5731
5614
|
bLength = _b.length;
|
|
5732
5615
|
}
|
|
5733
|
-
const truncated = aLength !==
|
|
5734
|
-
const isCommon = (aIndex2, bIndex2) =>
|
|
5616
|
+
const truncated = aLength !== a3.length || bLength !== b2.length;
|
|
5617
|
+
const isCommon = (aIndex2, bIndex2) => a3[aIndex2] === b2[bIndex2];
|
|
5735
5618
|
let aIndex = 0;
|
|
5736
5619
|
let bIndex = 0;
|
|
5737
5620
|
const diffs = [];
|
|
5738
5621
|
const foundSubsequence = (nCommon, aCommon, bCommon) => {
|
|
5739
5622
|
if (aIndex !== aCommon) {
|
|
5740
|
-
diffs.push(new Diff(DIFF_DELETE,
|
|
5623
|
+
diffs.push(new Diff(DIFF_DELETE, a3.slice(aIndex, aCommon)));
|
|
5741
5624
|
}
|
|
5742
5625
|
if (bIndex !== bCommon) {
|
|
5743
5626
|
diffs.push(new Diff(DIFF_INSERT, b2.slice(bIndex, bCommon)));
|
|
@@ -5748,7 +5631,7 @@ function diffStrings(a5, b2, options) {
|
|
|
5748
5631
|
};
|
|
5749
5632
|
diffSequences(aLength, bLength, isCommon, foundSubsequence);
|
|
5750
5633
|
if (aIndex !== aLength) {
|
|
5751
|
-
diffs.push(new Diff(DIFF_DELETE,
|
|
5634
|
+
diffs.push(new Diff(DIFF_DELETE, a3.slice(aIndex)));
|
|
5752
5635
|
}
|
|
5753
5636
|
if (bIndex !== bLength) {
|
|
5754
5637
|
diffs.push(new Diff(DIFF_INSERT, b2.slice(bIndex)));
|
|
@@ -5893,11 +5776,11 @@ function hasCommonDiff(diffs, isMultiline) {
|
|
|
5893
5776
|
}
|
|
5894
5777
|
return diffs.some((diff2) => diff2[0] === DIFF_EQUAL);
|
|
5895
5778
|
}
|
|
5896
|
-
function diffStringsUnified(
|
|
5897
|
-
if (
|
|
5898
|
-
const isMultiline =
|
|
5899
|
-
const [diffs, truncated] = diffStringsRaw(isMultiline ? `${
|
|
5900
|
-
` :
|
|
5779
|
+
function diffStringsUnified(a3, b2, options) {
|
|
5780
|
+
if (a3 !== b2 && a3.length !== 0 && b2.length !== 0) {
|
|
5781
|
+
const isMultiline = a3.includes("\n") || b2.includes("\n");
|
|
5782
|
+
const [diffs, truncated] = diffStringsRaw(isMultiline ? `${a3}
|
|
5783
|
+
` : a3, isMultiline ? `${b2}
|
|
5901
5784
|
` : b2, true, options);
|
|
5902
5785
|
if (hasCommonDiff(diffs, isMultiline)) {
|
|
5903
5786
|
const optionsNormalized = normalizeDiffOptions(options);
|
|
@@ -5905,10 +5788,10 @@ function diffStringsUnified(a5, b2, options) {
|
|
|
5905
5788
|
return printDiffLines(lines, truncated, optionsNormalized);
|
|
5906
5789
|
}
|
|
5907
5790
|
}
|
|
5908
|
-
return diffLinesUnified(
|
|
5791
|
+
return diffLinesUnified(a3.split("\n"), b2.split("\n"), options);
|
|
5909
5792
|
}
|
|
5910
|
-
function diffStringsRaw(
|
|
5911
|
-
const [diffs, truncated] = diffStrings(
|
|
5793
|
+
function diffStringsRaw(a3, b2, cleanup, options) {
|
|
5794
|
+
const [diffs, truncated] = diffStrings(a3, b2, options);
|
|
5912
5795
|
{
|
|
5913
5796
|
diff_cleanupSemantic(diffs);
|
|
5914
5797
|
}
|
|
@@ -5937,30 +5820,30 @@ var FALLBACK_FORMAT_OPTIONS = {
|
|
|
5937
5820
|
maxDepth: 8,
|
|
5938
5821
|
plugins: PLUGINS2
|
|
5939
5822
|
};
|
|
5940
|
-
function diff(
|
|
5941
|
-
if (Object.is(
|
|
5823
|
+
function diff(a3, b2, options) {
|
|
5824
|
+
if (Object.is(a3, b2)) {
|
|
5942
5825
|
return "";
|
|
5943
5826
|
}
|
|
5944
|
-
const aType = getType3(
|
|
5827
|
+
const aType = getType3(a3);
|
|
5945
5828
|
let expectedType = aType;
|
|
5946
5829
|
let omitDifference = false;
|
|
5947
|
-
if (aType === "object" && typeof
|
|
5948
|
-
if (
|
|
5830
|
+
if (aType === "object" && typeof a3.asymmetricMatch === "function") {
|
|
5831
|
+
if (a3.$$typeof !== /* @__PURE__ */ Symbol.for("jest.asymmetricMatcher")) {
|
|
5949
5832
|
return void 0;
|
|
5950
5833
|
}
|
|
5951
|
-
if (typeof
|
|
5834
|
+
if (typeof a3.getExpectedType !== "function") {
|
|
5952
5835
|
return void 0;
|
|
5953
5836
|
}
|
|
5954
|
-
expectedType =
|
|
5837
|
+
expectedType = a3.getExpectedType();
|
|
5955
5838
|
omitDifference = expectedType === "string";
|
|
5956
5839
|
}
|
|
5957
5840
|
if (expectedType !== getType3(b2)) {
|
|
5958
|
-
let truncate4 = function(
|
|
5959
|
-
return
|
|
5841
|
+
let truncate4 = function(s2) {
|
|
5842
|
+
return s2.length <= MAX_LENGTH ? s2 : `${s2.slice(0, MAX_LENGTH)}...`;
|
|
5960
5843
|
};
|
|
5961
5844
|
const { aAnnotation, aColor, aIndicator, bAnnotation, bColor, bIndicator } = normalizeDiffOptions(options);
|
|
5962
5845
|
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
5963
|
-
let aDisplay = format(
|
|
5846
|
+
let aDisplay = format(a3, formatOptions);
|
|
5964
5847
|
let bDisplay = format(b2, formatOptions);
|
|
5965
5848
|
const MAX_LENGTH = 1e5;
|
|
5966
5849
|
aDisplay = truncate4(aDisplay);
|
|
@@ -5978,20 +5861,20 @@ ${bDiff}`;
|
|
|
5978
5861
|
}
|
|
5979
5862
|
switch (aType) {
|
|
5980
5863
|
case "string":
|
|
5981
|
-
return diffLinesUnified(
|
|
5864
|
+
return diffLinesUnified(a3.split("\n"), b2.split("\n"), options);
|
|
5982
5865
|
case "boolean":
|
|
5983
5866
|
case "number":
|
|
5984
|
-
return comparePrimitive(
|
|
5867
|
+
return comparePrimitive(a3, b2, options);
|
|
5985
5868
|
case "map":
|
|
5986
|
-
return compareObjects(sortMap(
|
|
5869
|
+
return compareObjects(sortMap(a3), sortMap(b2), options);
|
|
5987
5870
|
case "set":
|
|
5988
|
-
return compareObjects(sortSet(
|
|
5871
|
+
return compareObjects(sortSet(a3), sortSet(b2), options);
|
|
5989
5872
|
default:
|
|
5990
|
-
return compareObjects(
|
|
5873
|
+
return compareObjects(a3, b2, options);
|
|
5991
5874
|
}
|
|
5992
5875
|
}
|
|
5993
|
-
function comparePrimitive(
|
|
5994
|
-
const aFormat = format(
|
|
5876
|
+
function comparePrimitive(a3, b2, options) {
|
|
5877
|
+
const aFormat = format(a3, FORMAT_OPTIONS);
|
|
5995
5878
|
const bFormat = format(b2, FORMAT_OPTIONS);
|
|
5996
5879
|
return aFormat === bFormat ? "" : diffLinesUnified(aFormat.split("\n"), bFormat.split("\n"), options);
|
|
5997
5880
|
}
|
|
@@ -6001,19 +5884,19 @@ function sortMap(map2) {
|
|
|
6001
5884
|
function sortSet(set3) {
|
|
6002
5885
|
return new Set(Array.from(set3.values()).sort());
|
|
6003
5886
|
}
|
|
6004
|
-
function compareObjects(
|
|
5887
|
+
function compareObjects(a3, b2, options) {
|
|
6005
5888
|
let difference;
|
|
6006
5889
|
let hasThrown = false;
|
|
6007
5890
|
try {
|
|
6008
5891
|
const formatOptions = getFormatOptions(FORMAT_OPTIONS, options);
|
|
6009
|
-
difference = getObjectsDifference(
|
|
5892
|
+
difference = getObjectsDifference(a3, b2, formatOptions, options);
|
|
6010
5893
|
} catch {
|
|
6011
5894
|
hasThrown = true;
|
|
6012
5895
|
}
|
|
6013
5896
|
const noDiffMessage = getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
6014
5897
|
if (difference === void 0 || difference === noDiffMessage) {
|
|
6015
5898
|
const formatOptions = getFormatOptions(FALLBACK_FORMAT_OPTIONS, options);
|
|
6016
|
-
difference = getObjectsDifference(
|
|
5899
|
+
difference = getObjectsDifference(a3, b2, formatOptions, options);
|
|
6017
5900
|
if (difference !== noDiffMessage && !hasThrown) {
|
|
6018
5901
|
difference = `${getCommonMessage(SIMILAR_MESSAGE, options)}
|
|
6019
5902
|
|
|
@@ -6031,17 +5914,17 @@ function getFormatOptions(formatOptions, options) {
|
|
|
6031
5914
|
maxDepth: maxDepth ?? formatOptions.maxDepth
|
|
6032
5915
|
};
|
|
6033
5916
|
}
|
|
6034
|
-
function getObjectsDifference(
|
|
5917
|
+
function getObjectsDifference(a3, b2, formatOptions, options) {
|
|
6035
5918
|
const formatOptionsZeroIndent = {
|
|
6036
5919
|
...formatOptions,
|
|
6037
5920
|
indent: 0
|
|
6038
5921
|
};
|
|
6039
|
-
const aCompare = format(
|
|
5922
|
+
const aCompare = format(a3, formatOptionsZeroIndent);
|
|
6040
5923
|
const bCompare = format(b2, formatOptionsZeroIndent);
|
|
6041
5924
|
if (aCompare === bCompare) {
|
|
6042
5925
|
return getCommonMessage(NO_DIFF_MESSAGE, options);
|
|
6043
5926
|
} else {
|
|
6044
|
-
const aDisplay = format(
|
|
5927
|
+
const aDisplay = format(a3, formatOptions);
|
|
6045
5928
|
const bDisplay = format(b2, formatOptions);
|
|
6046
5929
|
return diffLinesUnified2(aDisplay.split("\n"), bDisplay.split("\n"), aCompare.split("\n"), bCompare.split("\n"), options);
|
|
6047
5930
|
}
|
|
@@ -6129,13 +6012,13 @@ function replaceTrailingSpaces(text) {
|
|
|
6129
6012
|
return text.replace(/\s+$/gm, (spaces) => SPACE_SYMBOL.repeat(spaces.length));
|
|
6130
6013
|
}
|
|
6131
6014
|
function printReceived(object2) {
|
|
6132
|
-
return
|
|
6015
|
+
return u.red(replaceTrailingSpaces(stringify(object2)));
|
|
6133
6016
|
}
|
|
6134
6017
|
function printExpected(value) {
|
|
6135
|
-
return
|
|
6018
|
+
return u.green(replaceTrailingSpaces(stringify(value)));
|
|
6136
6019
|
}
|
|
6137
6020
|
function getCommonAndChangedSubstrings(diffs, op, hasCommonDiff2) {
|
|
6138
|
-
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ?
|
|
6021
|
+
return diffs.reduce((reduced, diff2) => reduced + (diff2[0] === DIFF_EQUAL ? diff2[1] : diff2[0] === op ? hasCommonDiff2 ? u.inverse(diff2[1]) : diff2[1] : ""), "");
|
|
6139
6022
|
}
|
|
6140
6023
|
|
|
6141
6024
|
// ../../node_modules/tinyspy/dist/index.js
|
|
@@ -6143,88 +6026,88 @@ function S(e, t) {
|
|
|
6143
6026
|
if (!e)
|
|
6144
6027
|
throw new Error(t);
|
|
6145
6028
|
}
|
|
6146
|
-
function
|
|
6029
|
+
function f2(e, t) {
|
|
6147
6030
|
return typeof t === e;
|
|
6148
6031
|
}
|
|
6149
6032
|
function w(e) {
|
|
6150
6033
|
return e instanceof Promise;
|
|
6151
6034
|
}
|
|
6152
|
-
function
|
|
6153
|
-
Object.defineProperty(e, t,
|
|
6035
|
+
function u2(e, t, r2) {
|
|
6036
|
+
Object.defineProperty(e, t, r2);
|
|
6154
6037
|
}
|
|
6155
|
-
function l(e, t,
|
|
6156
|
-
|
|
6038
|
+
function l(e, t, r2) {
|
|
6039
|
+
u2(e, t, { value: r2, configurable: true, writable: true });
|
|
6157
6040
|
}
|
|
6158
6041
|
var y = /* @__PURE__ */ Symbol.for("tinyspy:spy");
|
|
6159
6042
|
var x = /* @__PURE__ */ new Set();
|
|
6160
|
-
var
|
|
6043
|
+
var h2 = (e) => {
|
|
6161
6044
|
e.called = false, e.callCount = 0, e.calls = [], e.results = [], e.resolves = [], e.next = [];
|
|
6162
6045
|
};
|
|
6163
|
-
var k = (e) => (
|
|
6164
|
-
value: { reset: () =>
|
|
6046
|
+
var k = (e) => (u2(e, y, {
|
|
6047
|
+
value: { reset: () => h2(e[y]) }
|
|
6165
6048
|
}), e[y]);
|
|
6166
6049
|
var T = (e) => e[y] || k(e);
|
|
6167
6050
|
function R(e) {
|
|
6168
6051
|
S(
|
|
6169
|
-
|
|
6052
|
+
f2("function", e) || f2("undefined", e),
|
|
6170
6053
|
"cannot spy on a non-function value"
|
|
6171
6054
|
);
|
|
6172
|
-
let t = function(...
|
|
6055
|
+
let t = function(...s2) {
|
|
6173
6056
|
let n2 = T(t);
|
|
6174
|
-
n2.called = true, n2.callCount++, n2.calls.push(
|
|
6057
|
+
n2.called = true, n2.callCount++, n2.calls.push(s2);
|
|
6175
6058
|
let d = n2.next.shift();
|
|
6176
6059
|
if (d) {
|
|
6177
6060
|
n2.results.push(d);
|
|
6178
|
-
let [
|
|
6179
|
-
if (
|
|
6061
|
+
let [a3, i] = d;
|
|
6062
|
+
if (a3 === "ok")
|
|
6180
6063
|
return i;
|
|
6181
6064
|
throw i;
|
|
6182
6065
|
}
|
|
6183
|
-
let o, c = "ok",
|
|
6066
|
+
let o, c = "ok", p3 = n2.results.length;
|
|
6184
6067
|
if (n2.impl)
|
|
6185
6068
|
try {
|
|
6186
|
-
new.target ? o = Reflect.construct(n2.impl,
|
|
6187
|
-
} catch (
|
|
6188
|
-
throw o =
|
|
6069
|
+
new.target ? o = Reflect.construct(n2.impl, s2, new.target) : o = n2.impl.apply(this, s2), c = "ok";
|
|
6070
|
+
} catch (a3) {
|
|
6071
|
+
throw o = a3, c = "error", n2.results.push([c, a3]), a3;
|
|
6189
6072
|
}
|
|
6190
6073
|
let g = [c, o];
|
|
6191
6074
|
return w(o) && o.then(
|
|
6192
|
-
(
|
|
6193
|
-
(
|
|
6075
|
+
(a3) => n2.resolves[p3] = ["ok", a3],
|
|
6076
|
+
(a3) => n2.resolves[p3] = ["error", a3]
|
|
6194
6077
|
), n2.results.push(g), o;
|
|
6195
6078
|
};
|
|
6196
6079
|
l(t, "_isMockFunction", true), l(t, "length", e ? e.length : 0), l(t, "name", e && e.name || "spy");
|
|
6197
|
-
let
|
|
6198
|
-
return
|
|
6080
|
+
let r2 = T(t);
|
|
6081
|
+
return r2.reset(), r2.impl = e, t;
|
|
6199
6082
|
}
|
|
6200
6083
|
function v(e) {
|
|
6201
6084
|
return !!e && e._isMockFunction === true;
|
|
6202
6085
|
}
|
|
6203
6086
|
var b = (e, t) => {
|
|
6204
|
-
let
|
|
6205
|
-
if (
|
|
6206
|
-
return [e,
|
|
6207
|
-
let
|
|
6208
|
-
for (;
|
|
6209
|
-
let n2 = Object.getOwnPropertyDescriptor(
|
|
6087
|
+
let r2 = Object.getOwnPropertyDescriptor(e, t);
|
|
6088
|
+
if (r2)
|
|
6089
|
+
return [e, r2];
|
|
6090
|
+
let s2 = Object.getPrototypeOf(e);
|
|
6091
|
+
for (; s2 !== null; ) {
|
|
6092
|
+
let n2 = Object.getOwnPropertyDescriptor(s2, t);
|
|
6210
6093
|
if (n2)
|
|
6211
|
-
return [
|
|
6212
|
-
|
|
6094
|
+
return [s2, n2];
|
|
6095
|
+
s2 = Object.getPrototypeOf(s2);
|
|
6213
6096
|
}
|
|
6214
6097
|
};
|
|
6215
6098
|
var P = (e, t) => {
|
|
6216
6099
|
t != null && typeof t == "function" && t.prototype != null && Object.setPrototypeOf(e.prototype, t.prototype);
|
|
6217
6100
|
};
|
|
6218
|
-
function M(e, t,
|
|
6101
|
+
function M(e, t, r2) {
|
|
6219
6102
|
S(
|
|
6220
|
-
!
|
|
6103
|
+
!f2("undefined", e),
|
|
6221
6104
|
"spyOn could not find an object to spy upon"
|
|
6222
6105
|
), S(
|
|
6223
|
-
|
|
6106
|
+
f2("object", e) || f2("function", e),
|
|
6224
6107
|
"cannot spyOn on a primitive value"
|
|
6225
6108
|
);
|
|
6226
|
-
let [
|
|
6227
|
-
if (!
|
|
6109
|
+
let [s2, n2] = (() => {
|
|
6110
|
+
if (!f2("object", t))
|
|
6228
6111
|
return [t, "value"];
|
|
6229
6112
|
if ("getter" in t && "setter" in t)
|
|
6230
6113
|
throw new Error("cannot spy on both getter and setter");
|
|
@@ -6233,30 +6116,30 @@ function M(e, t, r4) {
|
|
|
6233
6116
|
if ("setter" in t)
|
|
6234
6117
|
return [t.setter, "set"];
|
|
6235
6118
|
throw new Error("specify getter or setter to spy on");
|
|
6236
|
-
})(), [d, o] = b(e,
|
|
6119
|
+
})(), [d, o] = b(e, s2) || [];
|
|
6237
6120
|
S(
|
|
6238
|
-
o ||
|
|
6239
|
-
`${String(
|
|
6121
|
+
o || s2 in e,
|
|
6122
|
+
`${String(s2)} does not exist`
|
|
6240
6123
|
);
|
|
6241
6124
|
let c = false;
|
|
6242
|
-
n2 === "value" && o && !o.value && o.get && (n2 = "get", c = true,
|
|
6243
|
-
let
|
|
6244
|
-
o ?
|
|
6125
|
+
n2 === "value" && o && !o.value && o.get && (n2 = "get", c = true, r2 = o.get());
|
|
6126
|
+
let p3;
|
|
6127
|
+
o ? p3 = o[n2] : n2 !== "value" ? p3 = () => e[s2] : p3 = e[s2], p3 && j(p3) && (p3 = p3[y].getOriginal());
|
|
6245
6128
|
let g = (I) => {
|
|
6246
6129
|
let { value: F, ...O } = o || {
|
|
6247
6130
|
configurable: true,
|
|
6248
6131
|
writable: true
|
|
6249
6132
|
};
|
|
6250
|
-
n2 !== "value" && delete O.writable, O[n2] = I,
|
|
6251
|
-
},
|
|
6252
|
-
d !== e ? Reflect.deleteProperty(e,
|
|
6133
|
+
n2 !== "value" && delete O.writable, O[n2] = I, u2(e, s2, O);
|
|
6134
|
+
}, a3 = () => {
|
|
6135
|
+
d !== e ? Reflect.deleteProperty(e, s2) : o && !p3 ? u2(e, s2, o) : g(p3);
|
|
6253
6136
|
};
|
|
6254
|
-
|
|
6255
|
-
let i = E(R(
|
|
6256
|
-
n2 === "value" && P(i,
|
|
6257
|
-
let
|
|
6258
|
-
return l(
|
|
6259
|
-
c ? () => (P(i,
|
|
6137
|
+
r2 || (r2 = p3);
|
|
6138
|
+
let i = E(R(r2), r2);
|
|
6139
|
+
n2 === "value" && P(i, p3);
|
|
6140
|
+
let m2 = i[y];
|
|
6141
|
+
return l(m2, "restore", a3), l(m2, "getOriginal", () => c ? p3() : p3), l(m2, "willCall", (I) => (m2.impl = I, i)), g(
|
|
6142
|
+
c ? () => (P(i, r2), i) : i
|
|
6260
6143
|
), x.add(i), i;
|
|
6261
6144
|
}
|
|
6262
6145
|
var K = /* @__PURE__ */ new Set([
|
|
@@ -6265,29 +6148,29 @@ var K = /* @__PURE__ */ new Set([
|
|
|
6265
6148
|
"prototype"
|
|
6266
6149
|
]);
|
|
6267
6150
|
function D(e) {
|
|
6268
|
-
let t = /* @__PURE__ */ new Set(),
|
|
6151
|
+
let t = /* @__PURE__ */ new Set(), r2 = {};
|
|
6269
6152
|
for (; e && e !== Object.prototype && e !== Function.prototype; ) {
|
|
6270
|
-
let
|
|
6153
|
+
let s2 = [
|
|
6271
6154
|
...Object.getOwnPropertyNames(e),
|
|
6272
6155
|
...Object.getOwnPropertySymbols(e)
|
|
6273
6156
|
];
|
|
6274
|
-
for (let n2 of
|
|
6275
|
-
|
|
6157
|
+
for (let n2 of s2)
|
|
6158
|
+
r2[n2] || K.has(n2) || (t.add(n2), r2[n2] = Object.getOwnPropertyDescriptor(e, n2));
|
|
6276
6159
|
e = Object.getPrototypeOf(e);
|
|
6277
6160
|
}
|
|
6278
6161
|
return {
|
|
6279
6162
|
properties: t,
|
|
6280
|
-
descriptors:
|
|
6163
|
+
descriptors: r2
|
|
6281
6164
|
};
|
|
6282
6165
|
}
|
|
6283
6166
|
function E(e, t) {
|
|
6284
6167
|
if (!t || // the original is already a spy, so it has all the properties
|
|
6285
6168
|
y in t)
|
|
6286
6169
|
return e;
|
|
6287
|
-
let { properties:
|
|
6288
|
-
for (let n2 of
|
|
6289
|
-
let d =
|
|
6290
|
-
b(e, n2) ||
|
|
6170
|
+
let { properties: r2, descriptors: s2 } = D(t);
|
|
6171
|
+
for (let n2 of r2) {
|
|
6172
|
+
let d = s2[n2];
|
|
6173
|
+
b(e, n2) || u2(e, n2, d);
|
|
6291
6174
|
}
|
|
6292
6175
|
return e;
|
|
6293
6176
|
}
|
|
@@ -6485,7 +6368,7 @@ function getDescriptor(obj, method) {
|
|
|
6485
6368
|
}
|
|
6486
6369
|
}
|
|
6487
6370
|
|
|
6488
|
-
// ../../node_modules
|
|
6371
|
+
// ../../node_modules/@vitest/expect/node_modules/@vitest/utils/dist/error.js
|
|
6489
6372
|
var IS_RECORD_SYMBOL = "@@__IMMUTABLE_RECORD__@@";
|
|
6490
6373
|
var IS_COLLECTION_SYMBOL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
6491
6374
|
function isImmutable(v2) {
|
|
@@ -6557,35 +6440,35 @@ function serializeValue(val, seen = /* @__PURE__ */ new WeakMap()) {
|
|
|
6557
6440
|
return seen.get(val);
|
|
6558
6441
|
}
|
|
6559
6442
|
if (Array.isArray(val)) {
|
|
6560
|
-
const
|
|
6561
|
-
seen.set(val,
|
|
6443
|
+
const clone4 = new Array(val.length);
|
|
6444
|
+
seen.set(val, clone4);
|
|
6562
6445
|
val.forEach((e, i) => {
|
|
6563
6446
|
try {
|
|
6564
|
-
|
|
6447
|
+
clone4[i] = serializeValue(e, seen);
|
|
6565
6448
|
} catch (err) {
|
|
6566
|
-
|
|
6449
|
+
clone4[i] = getUnserializableMessage(err);
|
|
6567
6450
|
}
|
|
6568
6451
|
});
|
|
6569
|
-
return
|
|
6452
|
+
return clone4;
|
|
6570
6453
|
} else {
|
|
6571
|
-
const
|
|
6572
|
-
seen.set(val,
|
|
6454
|
+
const clone4 = /* @__PURE__ */ Object.create(null);
|
|
6455
|
+
seen.set(val, clone4);
|
|
6573
6456
|
let obj = val;
|
|
6574
6457
|
while (obj && obj !== OBJECT_PROTO) {
|
|
6575
6458
|
Object.getOwnPropertyNames(obj).forEach((key) => {
|
|
6576
|
-
if (key in
|
|
6459
|
+
if (key in clone4) {
|
|
6577
6460
|
return;
|
|
6578
6461
|
}
|
|
6579
6462
|
try {
|
|
6580
|
-
|
|
6463
|
+
clone4[key] = serializeValue(val[key], seen);
|
|
6581
6464
|
} catch (err) {
|
|
6582
|
-
delete
|
|
6583
|
-
|
|
6465
|
+
delete clone4[key];
|
|
6466
|
+
clone4[key] = getUnserializableMessage(err);
|
|
6584
6467
|
}
|
|
6585
6468
|
});
|
|
6586
6469
|
obj = Object.getPrototypeOf(obj);
|
|
6587
6470
|
}
|
|
6588
|
-
return
|
|
6471
|
+
return clone4;
|
|
6589
6472
|
}
|
|
6590
6473
|
}
|
|
6591
6474
|
function safe(fn2) {
|
|
@@ -8381,8 +8264,8 @@ function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
|
|
8381
8264
|
}, "overwritingChainableMethodWrapper");
|
|
8382
8265
|
}
|
|
8383
8266
|
__name(overwriteChainableMethod, "overwriteChainableMethod");
|
|
8384
|
-
function compareByInspect(
|
|
8385
|
-
return inspect22(
|
|
8267
|
+
function compareByInspect(a3, b2) {
|
|
8268
|
+
return inspect22(a3) < inspect22(b2) ? -1 : 1;
|
|
8386
8269
|
}
|
|
8387
8270
|
__name(compareByInspect, "compareByInspect");
|
|
8388
8271
|
function getOwnEnumerablePropertySymbols(obj) {
|
|
@@ -8419,11 +8302,11 @@ function getOperator(obj, args) {
|
|
|
8419
8302
|
if (/\shave\s/.test(msg)) {
|
|
8420
8303
|
return void 0;
|
|
8421
8304
|
}
|
|
8422
|
-
let
|
|
8305
|
+
let isObject6 = isObjectType(expected);
|
|
8423
8306
|
if (/\snot\s/.test(msg)) {
|
|
8424
|
-
return
|
|
8307
|
+
return isObject6 ? "notDeepStrictEqual" : "notStrictEqual";
|
|
8425
8308
|
}
|
|
8426
|
-
return
|
|
8309
|
+
return isObject6 ? "deepStrictEqual" : "strictEqual";
|
|
8427
8310
|
}
|
|
8428
8311
|
__name(getOperator, "getOperator");
|
|
8429
8312
|
function getName(fn2) {
|
|
@@ -8516,8 +8399,8 @@ function an(type3, msg) {
|
|
|
8516
8399
|
__name(an, "an");
|
|
8517
8400
|
Assertion.addChainableMethod("an", an);
|
|
8518
8401
|
Assertion.addChainableMethod("a", an);
|
|
8519
|
-
function SameValueZero(
|
|
8520
|
-
return isNaN22(
|
|
8402
|
+
function SameValueZero(a3, b2) {
|
|
8403
|
+
return isNaN22(a3) && isNaN22(b2) || a3 === b2;
|
|
8521
8404
|
}
|
|
8522
8405
|
__name(SameValueZero, "SameValueZero");
|
|
8523
8406
|
function includeChainingBehavior() {
|
|
@@ -10654,7 +10537,7 @@ function use(fn2) {
|
|
|
10654
10537
|
}
|
|
10655
10538
|
__name(use, "use");
|
|
10656
10539
|
|
|
10657
|
-
// ../../node_modules
|
|
10540
|
+
// ../../node_modules/@vitest/expect/dist/index.js
|
|
10658
10541
|
var MATCHERS_OBJECT = /* @__PURE__ */ Symbol.for("matchers-object");
|
|
10659
10542
|
var JEST_MATCHERS_OBJECT = /* @__PURE__ */ Symbol.for("$$jest-matchers-object");
|
|
10660
10543
|
var GLOBAL_EXPECT = /* @__PURE__ */ Symbol.for("expect-global");
|
|
@@ -10703,11 +10586,11 @@ ${printReceived3(actual)}`
|
|
|
10703
10586
|
};
|
|
10704
10587
|
}
|
|
10705
10588
|
};
|
|
10706
|
-
var EXPECTED_COLOR =
|
|
10707
|
-
var RECEIVED_COLOR =
|
|
10708
|
-
var INVERTED_COLOR =
|
|
10709
|
-
var BOLD_WEIGHT =
|
|
10710
|
-
var DIM_COLOR =
|
|
10589
|
+
var EXPECTED_COLOR = u.green;
|
|
10590
|
+
var RECEIVED_COLOR = u.red;
|
|
10591
|
+
var INVERTED_COLOR = u.inverse;
|
|
10592
|
+
var BOLD_WEIGHT = u.bold;
|
|
10593
|
+
var DIM_COLOR = u.dim;
|
|
10711
10594
|
function matcherHint(matcherName, received = "received", expected = "expected", options = {}) {
|
|
10712
10595
|
const { comment = "", isDirectExpectCall = false, isNot = false, promise = "", secondArgument = "", expectedColor = EXPECTED_COLOR, receivedColor = RECEIVED_COLOR, secondArgumentColor = EXPECTED_COLOR } = options;
|
|
10713
10596
|
let hint = "";
|
|
@@ -10788,49 +10671,49 @@ function addCustomEqualityTesters(newTesters) {
|
|
|
10788
10671
|
function getCustomEqualityTesters() {
|
|
10789
10672
|
return globalThis[JEST_MATCHERS_OBJECT].customEqualityTesters;
|
|
10790
10673
|
}
|
|
10791
|
-
function equals(
|
|
10674
|
+
function equals(a3, b2, customTesters, strictCheck) {
|
|
10792
10675
|
customTesters = customTesters || [];
|
|
10793
|
-
return eq(
|
|
10676
|
+
return eq(a3, b2, [], [], customTesters, strictCheck ? hasKey : hasDefinedKey);
|
|
10794
10677
|
}
|
|
10795
10678
|
function isAsymmetric(obj) {
|
|
10796
10679
|
return !!obj && typeof obj === "object" && "asymmetricMatch" in obj && isA("Function", obj.asymmetricMatch);
|
|
10797
10680
|
}
|
|
10798
|
-
function asymmetricMatch(
|
|
10799
|
-
const asymmetricA = isAsymmetric(
|
|
10681
|
+
function asymmetricMatch(a3, b2) {
|
|
10682
|
+
const asymmetricA = isAsymmetric(a3);
|
|
10800
10683
|
const asymmetricB = isAsymmetric(b2);
|
|
10801
10684
|
if (asymmetricA && asymmetricB) {
|
|
10802
10685
|
return void 0;
|
|
10803
10686
|
}
|
|
10804
10687
|
if (asymmetricA) {
|
|
10805
|
-
return
|
|
10688
|
+
return a3.asymmetricMatch(b2);
|
|
10806
10689
|
}
|
|
10807
10690
|
if (asymmetricB) {
|
|
10808
|
-
return b2.asymmetricMatch(
|
|
10691
|
+
return b2.asymmetricMatch(a3);
|
|
10809
10692
|
}
|
|
10810
10693
|
}
|
|
10811
|
-
function eq(
|
|
10694
|
+
function eq(a3, b2, aStack, bStack, customTesters, hasKey2) {
|
|
10812
10695
|
let result = true;
|
|
10813
|
-
const asymmetricResult = asymmetricMatch(
|
|
10696
|
+
const asymmetricResult = asymmetricMatch(a3, b2);
|
|
10814
10697
|
if (asymmetricResult !== void 0) {
|
|
10815
10698
|
return asymmetricResult;
|
|
10816
10699
|
}
|
|
10817
10700
|
const testerContext = { equals };
|
|
10818
10701
|
for (let i = 0; i < customTesters.length; i++) {
|
|
10819
|
-
const customTesterResult = customTesters[i].call(testerContext,
|
|
10702
|
+
const customTesterResult = customTesters[i].call(testerContext, a3, b2, customTesters);
|
|
10820
10703
|
if (customTesterResult !== void 0) {
|
|
10821
10704
|
return customTesterResult;
|
|
10822
10705
|
}
|
|
10823
10706
|
}
|
|
10824
|
-
if (typeof URL === "function" &&
|
|
10825
|
-
return
|
|
10707
|
+
if (typeof URL === "function" && a3 instanceof URL && b2 instanceof URL) {
|
|
10708
|
+
return a3.href === b2.href;
|
|
10826
10709
|
}
|
|
10827
|
-
if (Object.is(
|
|
10710
|
+
if (Object.is(a3, b2)) {
|
|
10828
10711
|
return true;
|
|
10829
10712
|
}
|
|
10830
|
-
if (
|
|
10831
|
-
return
|
|
10713
|
+
if (a3 === null || b2 === null) {
|
|
10714
|
+
return a3 === b2;
|
|
10832
10715
|
}
|
|
10833
|
-
const className = Object.prototype.toString.call(
|
|
10716
|
+
const className = Object.prototype.toString.call(a3);
|
|
10834
10717
|
if (className !== Object.prototype.toString.call(b2)) {
|
|
10835
10718
|
return false;
|
|
10836
10719
|
}
|
|
@@ -10838,20 +10721,20 @@ function eq(a5, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
10838
10721
|
case "[object Boolean]":
|
|
10839
10722
|
case "[object String]":
|
|
10840
10723
|
case "[object Number]":
|
|
10841
|
-
if (typeof
|
|
10724
|
+
if (typeof a3 !== typeof b2) {
|
|
10842
10725
|
return false;
|
|
10843
|
-
} else if (typeof
|
|
10844
|
-
return Object.is(
|
|
10726
|
+
} else if (typeof a3 !== "object" && typeof b2 !== "object") {
|
|
10727
|
+
return Object.is(a3, b2);
|
|
10845
10728
|
} else {
|
|
10846
|
-
return Object.is(
|
|
10729
|
+
return Object.is(a3.valueOf(), b2.valueOf());
|
|
10847
10730
|
}
|
|
10848
10731
|
case "[object Date]": {
|
|
10849
|
-
const numA = +
|
|
10732
|
+
const numA = +a3;
|
|
10850
10733
|
const numB = +b2;
|
|
10851
10734
|
return numA === numB || Number.isNaN(numA) && Number.isNaN(numB);
|
|
10852
10735
|
}
|
|
10853
10736
|
case "[object RegExp]":
|
|
10854
|
-
return
|
|
10737
|
+
return a3.source === b2.source && a3.flags === b2.flags;
|
|
10855
10738
|
case "[object Temporal.Instant]":
|
|
10856
10739
|
case "[object Temporal.ZonedDateTime]":
|
|
10857
10740
|
case "[object Temporal.PlainDateTime]":
|
|
@@ -10859,38 +10742,38 @@ function eq(a5, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
10859
10742
|
case "[object Temporal.PlainTime]":
|
|
10860
10743
|
case "[object Temporal.PlainYearMonth]":
|
|
10861
10744
|
case "[object Temporal.PlainMonthDay]":
|
|
10862
|
-
return
|
|
10745
|
+
return a3.equals(b2);
|
|
10863
10746
|
case "[object Temporal.Duration]":
|
|
10864
|
-
return
|
|
10747
|
+
return a3.toString() === b2.toString();
|
|
10865
10748
|
}
|
|
10866
|
-
if (typeof
|
|
10749
|
+
if (typeof a3 !== "object" || typeof b2 !== "object") {
|
|
10867
10750
|
return false;
|
|
10868
10751
|
}
|
|
10869
|
-
if (isDomNode(
|
|
10870
|
-
return
|
|
10752
|
+
if (isDomNode(a3) && isDomNode(b2)) {
|
|
10753
|
+
return a3.isEqualNode(b2);
|
|
10871
10754
|
}
|
|
10872
10755
|
let length = aStack.length;
|
|
10873
10756
|
while (length--) {
|
|
10874
|
-
if (aStack[length] ===
|
|
10757
|
+
if (aStack[length] === a3) {
|
|
10875
10758
|
return bStack[length] === b2;
|
|
10876
10759
|
} else if (bStack[length] === b2) {
|
|
10877
10760
|
return false;
|
|
10878
10761
|
}
|
|
10879
10762
|
}
|
|
10880
|
-
aStack.push(
|
|
10763
|
+
aStack.push(a3);
|
|
10881
10764
|
bStack.push(b2);
|
|
10882
|
-
if (className === "[object Array]" &&
|
|
10765
|
+
if (className === "[object Array]" && a3.length !== b2.length) {
|
|
10883
10766
|
return false;
|
|
10884
10767
|
}
|
|
10885
|
-
if (
|
|
10768
|
+
if (a3 instanceof Error && b2 instanceof Error) {
|
|
10886
10769
|
try {
|
|
10887
|
-
return isErrorEqual(
|
|
10770
|
+
return isErrorEqual(a3, b2, aStack, bStack, customTesters, hasKey2);
|
|
10888
10771
|
} finally {
|
|
10889
10772
|
aStack.pop();
|
|
10890
10773
|
bStack.pop();
|
|
10891
10774
|
}
|
|
10892
10775
|
}
|
|
10893
|
-
const aKeys = keys(
|
|
10776
|
+
const aKeys = keys(a3, hasKey2);
|
|
10894
10777
|
let key;
|
|
10895
10778
|
let size = aKeys.length;
|
|
10896
10779
|
if (keys(b2, hasKey2).length !== size) {
|
|
@@ -10898,7 +10781,7 @@ function eq(a5, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
10898
10781
|
}
|
|
10899
10782
|
while (size--) {
|
|
10900
10783
|
key = aKeys[size];
|
|
10901
|
-
result = hasKey2(b2, key) && eq(
|
|
10784
|
+
result = hasKey2(b2, key) && eq(a3[key], b2[key], aStack, bStack, customTesters, hasKey2);
|
|
10902
10785
|
if (!result) {
|
|
10903
10786
|
return false;
|
|
10904
10787
|
}
|
|
@@ -10907,15 +10790,15 @@ function eq(a5, b2, aStack, bStack, customTesters, hasKey2) {
|
|
|
10907
10790
|
bStack.pop();
|
|
10908
10791
|
return result;
|
|
10909
10792
|
}
|
|
10910
|
-
function isErrorEqual(
|
|
10911
|
-
let result = Object.getPrototypeOf(
|
|
10793
|
+
function isErrorEqual(a3, b2, aStack, bStack, customTesters, hasKey2) {
|
|
10794
|
+
let result = Object.getPrototypeOf(a3) === Object.getPrototypeOf(b2) && a3.name === b2.name && a3.message === b2.message;
|
|
10912
10795
|
if (typeof b2.cause !== "undefined") {
|
|
10913
|
-
result && (result = eq(
|
|
10796
|
+
result && (result = eq(a3.cause, b2.cause, aStack, bStack, customTesters, hasKey2));
|
|
10914
10797
|
}
|
|
10915
|
-
if (
|
|
10916
|
-
result && (result = eq(
|
|
10798
|
+
if (a3 instanceof AggregateError && b2 instanceof AggregateError) {
|
|
10799
|
+
result && (result = eq(a3.errors, b2.errors, aStack, bStack, customTesters, hasKey2));
|
|
10917
10800
|
}
|
|
10918
|
-
result && (result = eq({ ...
|
|
10801
|
+
result && (result = eq({ ...a3 }, { ...b2 }, aStack, bStack, customTesters, hasKey2));
|
|
10919
10802
|
return result;
|
|
10920
10803
|
}
|
|
10921
10804
|
function keys(obj, hasKey2) {
|
|
@@ -10969,31 +10852,31 @@ var IteratorSymbol = Symbol.iterator;
|
|
|
10969
10852
|
function hasIterator(object2) {
|
|
10970
10853
|
return !!(object2 != null && object2[IteratorSymbol]);
|
|
10971
10854
|
}
|
|
10972
|
-
function iterableEquality(
|
|
10973
|
-
if (typeof
|
|
10855
|
+
function iterableEquality(a3, b2, customTesters = [], aStack = [], bStack = []) {
|
|
10856
|
+
if (typeof a3 !== "object" || typeof b2 !== "object" || Array.isArray(a3) || Array.isArray(b2) || !hasIterator(a3) || !hasIterator(b2)) {
|
|
10974
10857
|
return void 0;
|
|
10975
10858
|
}
|
|
10976
|
-
if (
|
|
10859
|
+
if (a3.constructor !== b2.constructor) {
|
|
10977
10860
|
return false;
|
|
10978
10861
|
}
|
|
10979
10862
|
let length = aStack.length;
|
|
10980
10863
|
while (length--) {
|
|
10981
|
-
if (aStack[length] ===
|
|
10864
|
+
if (aStack[length] === a3) {
|
|
10982
10865
|
return bStack[length] === b2;
|
|
10983
10866
|
}
|
|
10984
10867
|
}
|
|
10985
|
-
aStack.push(
|
|
10868
|
+
aStack.push(a3);
|
|
10986
10869
|
bStack.push(b2);
|
|
10987
10870
|
const filteredCustomTesters = [...customTesters.filter((t) => t !== iterableEquality), iterableEqualityWithStack];
|
|
10988
|
-
function iterableEqualityWithStack(
|
|
10989
|
-
return iterableEquality(
|
|
10871
|
+
function iterableEqualityWithStack(a4, b3) {
|
|
10872
|
+
return iterableEquality(a4, b3, [...customTesters], [...aStack], [...bStack]);
|
|
10990
10873
|
}
|
|
10991
|
-
if (
|
|
10992
|
-
if (
|
|
10874
|
+
if (a3.size !== void 0) {
|
|
10875
|
+
if (a3.size !== b2.size) {
|
|
10993
10876
|
return false;
|
|
10994
|
-
} else if (isA("Set",
|
|
10877
|
+
} else if (isA("Set", a3) || isImmutableUnorderedSet(a3)) {
|
|
10995
10878
|
let allFound = true;
|
|
10996
|
-
for (const aValue of
|
|
10879
|
+
for (const aValue of a3) {
|
|
10997
10880
|
if (!b2.has(aValue)) {
|
|
10998
10881
|
let has = false;
|
|
10999
10882
|
for (const bValue of b2) {
|
|
@@ -11011,9 +10894,9 @@ function iterableEquality(a5, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
11011
10894
|
aStack.pop();
|
|
11012
10895
|
bStack.pop();
|
|
11013
10896
|
return allFound;
|
|
11014
|
-
} else if (isA("Map",
|
|
10897
|
+
} else if (isA("Map", a3) || isImmutableUnorderedKeyed(a3)) {
|
|
11015
10898
|
let allFound = true;
|
|
11016
|
-
for (const aEntry of
|
|
10899
|
+
for (const aEntry of a3) {
|
|
11017
10900
|
if (!b2.has(aEntry[0]) || !equals(aEntry[1], b2.get(aEntry[0]), filteredCustomTesters)) {
|
|
11018
10901
|
let has = false;
|
|
11019
10902
|
for (const bEntry of b2) {
|
|
@@ -11038,7 +10921,7 @@ function iterableEquality(a5, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
11038
10921
|
}
|
|
11039
10922
|
}
|
|
11040
10923
|
const bIterator = b2[IteratorSymbol]();
|
|
11041
|
-
for (const aValue of
|
|
10924
|
+
for (const aValue of a3) {
|
|
11042
10925
|
const nextB = bIterator.next();
|
|
11043
10926
|
if (nextB.done || !equals(aValue, nextB.value, filteredCustomTesters)) {
|
|
11044
10927
|
return false;
|
|
@@ -11047,8 +10930,8 @@ function iterableEquality(a5, b2, customTesters = [], aStack = [], bStack = [])
|
|
|
11047
10930
|
if (!bIterator.next().done) {
|
|
11048
10931
|
return false;
|
|
11049
10932
|
}
|
|
11050
|
-
if (!isImmutableList(
|
|
11051
|
-
const aEntries = Object.entries(
|
|
10933
|
+
if (!isImmutableList(a3) && !isImmutableOrderedKeyed(a3) && !isImmutableOrderedSet(a3) && !isImmutableRecord(a3)) {
|
|
10934
|
+
const aEntries = Object.entries(a3);
|
|
11052
10935
|
const bEntries = Object.entries(b2);
|
|
11053
10936
|
if (!equals(aEntries, bEntries, filteredCustomTesters)) {
|
|
11054
10937
|
return false;
|
|
@@ -11065,8 +10948,8 @@ function hasPropertyInObject(object2, key) {
|
|
|
11065
10948
|
}
|
|
11066
10949
|
return Object.prototype.hasOwnProperty.call(object2, key) || hasPropertyInObject(Object.getPrototypeOf(object2), key);
|
|
11067
10950
|
}
|
|
11068
|
-
function isObjectWithKeys(
|
|
11069
|
-
return isObject(
|
|
10951
|
+
function isObjectWithKeys(a3) {
|
|
10952
|
+
return isObject(a3) && !(a3 instanceof Error) && !Array.isArray(a3) && !(a3 instanceof Date);
|
|
11070
10953
|
}
|
|
11071
10954
|
function subsetEquality(object2, subset, customTesters = []) {
|
|
11072
10955
|
const filteredCustomTesters = customTesters.filter((t) => t !== subsetEquality);
|
|
@@ -11088,21 +10971,21 @@ function subsetEquality(object2, subset, customTesters = []) {
|
|
|
11088
10971
|
};
|
|
11089
10972
|
return subsetEqualityWithContext()(object2, subset);
|
|
11090
10973
|
}
|
|
11091
|
-
function typeEquality(
|
|
11092
|
-
if (
|
|
10974
|
+
function typeEquality(a3, b2) {
|
|
10975
|
+
if (a3 == null || b2 == null || a3.constructor === b2.constructor) {
|
|
11093
10976
|
return void 0;
|
|
11094
10977
|
}
|
|
11095
10978
|
return false;
|
|
11096
10979
|
}
|
|
11097
|
-
function arrayBufferEquality(
|
|
11098
|
-
let dataViewA =
|
|
10980
|
+
function arrayBufferEquality(a3, b2) {
|
|
10981
|
+
let dataViewA = a3;
|
|
11099
10982
|
let dataViewB = b2;
|
|
11100
|
-
if (!(
|
|
11101
|
-
if (!(
|
|
10983
|
+
if (!(a3 instanceof DataView && b2 instanceof DataView)) {
|
|
10984
|
+
if (!(a3 instanceof ArrayBuffer) || !(b2 instanceof ArrayBuffer)) {
|
|
11102
10985
|
return void 0;
|
|
11103
10986
|
}
|
|
11104
10987
|
try {
|
|
11105
|
-
dataViewA = new DataView(
|
|
10988
|
+
dataViewA = new DataView(a3);
|
|
11106
10989
|
dataViewB = new DataView(b2);
|
|
11107
10990
|
} catch {
|
|
11108
10991
|
return void 0;
|
|
@@ -11118,14 +11001,14 @@ function arrayBufferEquality(a5, b2) {
|
|
|
11118
11001
|
}
|
|
11119
11002
|
return true;
|
|
11120
11003
|
}
|
|
11121
|
-
function sparseArrayEquality(
|
|
11122
|
-
if (!Array.isArray(
|
|
11004
|
+
function sparseArrayEquality(a3, b2, customTesters = []) {
|
|
11005
|
+
if (!Array.isArray(a3) || !Array.isArray(b2)) {
|
|
11123
11006
|
return void 0;
|
|
11124
11007
|
}
|
|
11125
|
-
const aKeys = Object.keys(
|
|
11008
|
+
const aKeys = Object.keys(a3);
|
|
11126
11009
|
const bKeys = Object.keys(b2);
|
|
11127
11010
|
const filteredCustomTesters = customTesters.filter((t) => t !== sparseArrayEquality);
|
|
11128
|
-
return equals(
|
|
11011
|
+
return equals(a3, b2, filteredCustomTesters, true) && equals(aKeys, bKeys);
|
|
11129
11012
|
}
|
|
11130
11013
|
function generateToBeMessage(deepEqualityName, expected = "#{this}", actual = "#{exp}") {
|
|
11131
11014
|
const toBeMessage = `expected ${expected} to be ${actual} // Object.is equality`;
|
|
@@ -11144,9 +11027,9 @@ function pluralize(word, count) {
|
|
|
11144
11027
|
return `${count} ${word}${count === 1 ? "" : "s"}`;
|
|
11145
11028
|
}
|
|
11146
11029
|
function getObjectKeys(object2) {
|
|
11147
|
-
return [...Object.keys(object2), ...Object.getOwnPropertySymbols(object2).filter((
|
|
11030
|
+
return [...Object.keys(object2), ...Object.getOwnPropertySymbols(object2).filter((s2) => {
|
|
11148
11031
|
var _Object$getOwnPropert;
|
|
11149
|
-
return (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(object2,
|
|
11032
|
+
return (_Object$getOwnPropert = Object.getOwnPropertyDescriptor(object2, s2)) === null || _Object$getOwnPropert === void 0 ? void 0 : _Object$getOwnPropert.enumerable;
|
|
11150
11033
|
})];
|
|
11151
11034
|
}
|
|
11152
11035
|
function getObjectSubset(object2, subset, customTesters) {
|
|
@@ -11514,7 +11397,7 @@ function recordAsyncExpect(_test2, promise, assertion, error) {
|
|
|
11514
11397
|
test5.onFinished.push(() => {
|
|
11515
11398
|
if (!resolved) {
|
|
11516
11399
|
var _vitest_worker__;
|
|
11517
|
-
const processor = ((_vitest_worker__ = globalThis.__vitest_worker__) === null || _vitest_worker__ === void 0 ? void 0 : _vitest_worker__.onFilterStackTrace) || ((
|
|
11400
|
+
const processor = ((_vitest_worker__ = globalThis.__vitest_worker__) === null || _vitest_worker__ === void 0 ? void 0 : _vitest_worker__.onFilterStackTrace) || ((s2) => s2 || "");
|
|
11518
11401
|
const stack = processor(error.stack);
|
|
11519
11402
|
console.warn([
|
|
11520
11403
|
`Promise returned by \`${assertion}\` was not awaited. `,
|
|
@@ -11591,8 +11474,8 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
11591
11474
|
"throw",
|
|
11592
11475
|
"throws",
|
|
11593
11476
|
"Throw"
|
|
11594
|
-
].forEach((
|
|
11595
|
-
utils.overwriteMethod(chai2.Assertion.prototype,
|
|
11477
|
+
].forEach((m2) => {
|
|
11478
|
+
utils.overwriteMethod(chai2.Assertion.prototype, m2, (_super) => {
|
|
11596
11479
|
return function(...args) {
|
|
11597
11480
|
const promise = utils.flag(this, "promise");
|
|
11598
11481
|
const object2 = utils.flag(this, "object");
|
|
@@ -11857,8 +11740,8 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
11857
11740
|
throw new AssertionError2(msg);
|
|
11858
11741
|
}
|
|
11859
11742
|
});
|
|
11860
|
-
function equalsArgumentArray(
|
|
11861
|
-
return
|
|
11743
|
+
function equalsArgumentArray(a3, b2) {
|
|
11744
|
+
return a3.length === b2.length && a3.every((aItem, i) => equals(aItem, b2[i], [...customTesters, iterableEquality]));
|
|
11862
11745
|
}
|
|
11863
11746
|
def(["toHaveBeenCalledWith", "toBeCalledWith"], function(...args) {
|
|
11864
11747
|
const spy = getSpy(this);
|
|
@@ -11995,11 +11878,11 @@ var JestChaiExpect = (chai2, utils) => {
|
|
|
11995
11878
|
});
|
|
11996
11879
|
[{
|
|
11997
11880
|
name: "toHaveResolvedTimes",
|
|
11998
|
-
condition: (spy, times) => spy.mock.settledResults.reduce((
|
|
11881
|
+
condition: (spy, times) => spy.mock.settledResults.reduce((s2, { type: type3 }) => type3 === "fulfilled" ? ++s2 : s2, 0) === times,
|
|
11999
11882
|
action: "resolved"
|
|
12000
11883
|
}, {
|
|
12001
11884
|
name: ["toHaveReturnedTimes", "toReturnTimes"],
|
|
12002
|
-
condition: (spy, times) => spy.mock.results.reduce((
|
|
11885
|
+
condition: (spy, times) => spy.mock.results.reduce((s2, { type: type3 }) => type3 === "throw" ? s2 : ++s2, 0) === times,
|
|
12003
11886
|
action: "called"
|
|
12004
11887
|
}].forEach(({ name, condition, action }) => {
|
|
12005
11888
|
def(name, function(times) {
|
|
@@ -12175,12 +12058,12 @@ function ordinalOf(i) {
|
|
|
12175
12058
|
}
|
|
12176
12059
|
function formatCalls(spy, msg, showActualCall) {
|
|
12177
12060
|
if (spy.mock.calls.length) {
|
|
12178
|
-
msg +=
|
|
12061
|
+
msg += u.gray(`
|
|
12179
12062
|
|
|
12180
12063
|
Received:
|
|
12181
12064
|
|
|
12182
12065
|
${spy.mock.calls.map((callArg, i) => {
|
|
12183
|
-
let methodCall =
|
|
12066
|
+
let methodCall = u.bold(` ${ordinalOf(i + 1)} ${spy.getMockName()} call:
|
|
12184
12067
|
|
|
12185
12068
|
`);
|
|
12186
12069
|
if (showActualCall) {
|
|
@@ -12192,20 +12075,20 @@ ${spy.mock.calls.map((callArg, i) => {
|
|
|
12192
12075
|
return methodCall;
|
|
12193
12076
|
}).join("\n")}`);
|
|
12194
12077
|
}
|
|
12195
|
-
msg +=
|
|
12078
|
+
msg += u.gray(`
|
|
12196
12079
|
|
|
12197
|
-
Number of calls: ${
|
|
12080
|
+
Number of calls: ${u.bold(spy.mock.calls.length)}
|
|
12198
12081
|
`);
|
|
12199
12082
|
return msg;
|
|
12200
12083
|
}
|
|
12201
12084
|
function formatReturns(spy, results, msg, showActualReturn) {
|
|
12202
12085
|
if (results.length) {
|
|
12203
|
-
msg +=
|
|
12086
|
+
msg += u.gray(`
|
|
12204
12087
|
|
|
12205
12088
|
Received:
|
|
12206
12089
|
|
|
12207
12090
|
${results.map((callReturn, i) => {
|
|
12208
|
-
let methodCall =
|
|
12091
|
+
let methodCall = u.bold(` ${ordinalOf(i + 1)} ${spy.getMockName()} call return:
|
|
12209
12092
|
|
|
12210
12093
|
`);
|
|
12211
12094
|
if (showActualReturn) {
|
|
@@ -12217,9 +12100,9 @@ ${results.map((callReturn, i) => {
|
|
|
12217
12100
|
return methodCall;
|
|
12218
12101
|
}).join("\n")}`);
|
|
12219
12102
|
}
|
|
12220
|
-
msg +=
|
|
12103
|
+
msg += u.gray(`
|
|
12221
12104
|
|
|
12222
|
-
Number of calls: ${
|
|
12105
|
+
Number of calls: ${u.bold(spy.mock.calls.length)}
|
|
12223
12106
|
`);
|
|
12224
12107
|
return msg;
|
|
12225
12108
|
}
|
|
@@ -12398,8 +12281,8 @@ function format3(...args) {
|
|
|
12398
12281
|
try {
|
|
12399
12282
|
return JSON.stringify(args[i++]);
|
|
12400
12283
|
} catch (err) {
|
|
12401
|
-
const
|
|
12402
|
-
if (
|
|
12284
|
+
const m2 = err.message;
|
|
12285
|
+
if (m2.includes("circular structure") || m2.includes("cyclic structures") || m2.includes("cyclic object")) {
|
|
12403
12286
|
return "[Circular]";
|
|
12404
12287
|
}
|
|
12405
12288
|
throw err;
|
|
@@ -12460,8 +12343,8 @@ function isObject2(item) {
|
|
|
12460
12343
|
function objectAttr2(source, path, defaultValue = void 0) {
|
|
12461
12344
|
const paths = path.replace(/\[(\d+)\]/g, ".$1").split(".");
|
|
12462
12345
|
let result = source;
|
|
12463
|
-
for (const
|
|
12464
|
-
result = new Object(result)[
|
|
12346
|
+
for (const p3 of paths) {
|
|
12347
|
+
result = new Object(result)[p3];
|
|
12465
12348
|
if (result === void 0) {
|
|
12466
12349
|
return defaultValue;
|
|
12467
12350
|
}
|
|
@@ -12471,13 +12354,13 @@ function objectAttr2(source, path, defaultValue = void 0) {
|
|
|
12471
12354
|
function createDefer2() {
|
|
12472
12355
|
let resolve5 = null;
|
|
12473
12356
|
let reject = null;
|
|
12474
|
-
const
|
|
12357
|
+
const p3 = new Promise((_resolve, _reject) => {
|
|
12475
12358
|
resolve5 = _resolve;
|
|
12476
12359
|
reject = _reject;
|
|
12477
12360
|
});
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
return
|
|
12361
|
+
p3.resolve = resolve5;
|
|
12362
|
+
p3.reject = reject;
|
|
12363
|
+
return p3;
|
|
12481
12364
|
}
|
|
12482
12365
|
function isNegativeNaN2(val) {
|
|
12483
12366
|
if (!Number.isNaN(val)) {
|
|
@@ -12490,87 +12373,6 @@ function isNegativeNaN2(val) {
|
|
|
12490
12373
|
return isNegative;
|
|
12491
12374
|
}
|
|
12492
12375
|
|
|
12493
|
-
// ../../node_modules/@vitest/runner/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.js
|
|
12494
|
-
var f4 = {
|
|
12495
|
-
reset: [0, 0],
|
|
12496
|
-
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
12497
|
-
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
12498
|
-
italic: [3, 23],
|
|
12499
|
-
underline: [4, 24],
|
|
12500
|
-
inverse: [7, 27],
|
|
12501
|
-
hidden: [8, 28],
|
|
12502
|
-
strikethrough: [9, 29],
|
|
12503
|
-
black: [30, 39],
|
|
12504
|
-
red: [31, 39],
|
|
12505
|
-
green: [32, 39],
|
|
12506
|
-
yellow: [33, 39],
|
|
12507
|
-
blue: [34, 39],
|
|
12508
|
-
magenta: [35, 39],
|
|
12509
|
-
cyan: [36, 39],
|
|
12510
|
-
white: [37, 39],
|
|
12511
|
-
gray: [90, 39],
|
|
12512
|
-
bgBlack: [40, 49],
|
|
12513
|
-
bgRed: [41, 49],
|
|
12514
|
-
bgGreen: [42, 49],
|
|
12515
|
-
bgYellow: [43, 49],
|
|
12516
|
-
bgBlue: [44, 49],
|
|
12517
|
-
bgMagenta: [45, 49],
|
|
12518
|
-
bgCyan: [46, 49],
|
|
12519
|
-
bgWhite: [47, 49],
|
|
12520
|
-
blackBright: [90, 39],
|
|
12521
|
-
redBright: [91, 39],
|
|
12522
|
-
greenBright: [92, 39],
|
|
12523
|
-
yellowBright: [93, 39],
|
|
12524
|
-
blueBright: [94, 39],
|
|
12525
|
-
magentaBright: [95, 39],
|
|
12526
|
-
cyanBright: [96, 39],
|
|
12527
|
-
whiteBright: [97, 39],
|
|
12528
|
-
bgBlackBright: [100, 49],
|
|
12529
|
-
bgRedBright: [101, 49],
|
|
12530
|
-
bgGreenBright: [102, 49],
|
|
12531
|
-
bgYellowBright: [103, 49],
|
|
12532
|
-
bgBlueBright: [104, 49],
|
|
12533
|
-
bgMagentaBright: [105, 49],
|
|
12534
|
-
bgCyanBright: [106, 49],
|
|
12535
|
-
bgWhiteBright: [107, 49]
|
|
12536
|
-
};
|
|
12537
|
-
var h4 = Object.entries(f4);
|
|
12538
|
-
function a3(n2) {
|
|
12539
|
-
return String(n2);
|
|
12540
|
-
}
|
|
12541
|
-
a3.open = "";
|
|
12542
|
-
a3.close = "";
|
|
12543
|
-
function C3(n2 = false) {
|
|
12544
|
-
let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
|
|
12545
|
-
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n2 && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
|
|
12546
|
-
}
|
|
12547
|
-
function p3(n2 = false) {
|
|
12548
|
-
let e = C3(n2), i = (r4, t, c, o) => {
|
|
12549
|
-
let l2 = "", s4 = 0;
|
|
12550
|
-
do
|
|
12551
|
-
l2 += r4.substring(s4, o) + c, s4 = o + t.length, o = r4.indexOf(t, s4);
|
|
12552
|
-
while (~o);
|
|
12553
|
-
return l2 + r4.substring(s4);
|
|
12554
|
-
}, g = (r4, t, c = r4) => {
|
|
12555
|
-
let o = (l2) => {
|
|
12556
|
-
let s4 = String(l2), b2 = s4.indexOf(t, r4.length);
|
|
12557
|
-
return ~b2 ? r4 + i(s4, t, c, b2) + t : r4 + s4 + t;
|
|
12558
|
-
};
|
|
12559
|
-
return o.open = r4, o.close = t, o;
|
|
12560
|
-
}, u5 = {
|
|
12561
|
-
isColorSupported: e
|
|
12562
|
-
}, d = (r4) => `\x1B[${r4}m`;
|
|
12563
|
-
for (let [r4, t] of h4)
|
|
12564
|
-
u5[r4] = e ? g(
|
|
12565
|
-
d(t[0]),
|
|
12566
|
-
d(t[1]),
|
|
12567
|
-
t[2]
|
|
12568
|
-
) : a3;
|
|
12569
|
-
return u5;
|
|
12570
|
-
}
|
|
12571
|
-
var r3 = process.env.FORCE_TTY !== void 0 || isatty(1);
|
|
12572
|
-
p3(r3);
|
|
12573
|
-
|
|
12574
12376
|
// ../../node_modules/@vitest/runner/node_modules/@vitest/utils/dist/index.js
|
|
12575
12377
|
var jsTokens_12;
|
|
12576
12378
|
var hasRequiredJsTokens2;
|
|
@@ -13018,10 +12820,10 @@ var reservedWords2 = {
|
|
|
13018
12820
|
};
|
|
13019
12821
|
new Set(reservedWords2.keyword);
|
|
13020
12822
|
new Set(reservedWords2.strict);
|
|
13021
|
-
var
|
|
13022
|
-
function
|
|
13023
|
-
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[
|
|
13024
|
-
const { nextTick: safeNextTick } = globalThis[
|
|
12823
|
+
var SAFE_TIMERS_SYMBOL = /* @__PURE__ */ Symbol("vitest:SAFE_TIMERS");
|
|
12824
|
+
function getSafeTimers() {
|
|
12825
|
+
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
|
|
12826
|
+
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || { nextTick: (cb) => cb() };
|
|
13025
12827
|
return {
|
|
13026
12828
|
nextTick: safeNextTick,
|
|
13027
12829
|
setTimeout: safeSetTimeout,
|
|
@@ -13056,7 +12858,7 @@ function normalizeWindowsPath(input = "") {
|
|
|
13056
12858
|
if (!input) {
|
|
13057
12859
|
return input;
|
|
13058
12860
|
}
|
|
13059
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (
|
|
12861
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r2) => r2.toUpperCase());
|
|
13060
12862
|
}
|
|
13061
12863
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
13062
12864
|
function cwd() {
|
|
@@ -13143,8 +12945,8 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
13143
12945
|
}
|
|
13144
12946
|
return res;
|
|
13145
12947
|
}
|
|
13146
|
-
var isAbsolute = function(
|
|
13147
|
-
return _IS_ABSOLUTE_RE.test(
|
|
12948
|
+
var isAbsolute = function(p3) {
|
|
12949
|
+
return _IS_ABSOLUTE_RE.test(p3);
|
|
13148
12950
|
};
|
|
13149
12951
|
var CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
13150
12952
|
var SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
@@ -13316,7 +13118,7 @@ function normalizeWindowsPath2(input = "") {
|
|
|
13316
13118
|
if (!input) {
|
|
13317
13119
|
return input;
|
|
13318
13120
|
}
|
|
13319
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (
|
|
13121
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE2, (r2) => r2.toUpperCase());
|
|
13320
13122
|
}
|
|
13321
13123
|
var _IS_ABSOLUTE_RE2 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
13322
13124
|
function cwd2() {
|
|
@@ -13403,8 +13205,8 @@ function normalizeString2(path, allowAboveRoot) {
|
|
|
13403
13205
|
}
|
|
13404
13206
|
return res;
|
|
13405
13207
|
}
|
|
13406
|
-
var isAbsolute2 = function(
|
|
13407
|
-
return _IS_ABSOLUTE_RE2.test(
|
|
13208
|
+
var isAbsolute2 = function(p3) {
|
|
13209
|
+
return _IS_ABSOLUTE_RE2.test(p3);
|
|
13408
13210
|
};
|
|
13409
13211
|
|
|
13410
13212
|
// ../../node_modules/@vitest/runner/dist/chunk-hooks.js
|
|
@@ -13670,24 +13472,24 @@ function getUsedProps(fn2) {
|
|
|
13670
13472
|
}
|
|
13671
13473
|
return props;
|
|
13672
13474
|
}
|
|
13673
|
-
function splitByComma(
|
|
13475
|
+
function splitByComma(s2) {
|
|
13674
13476
|
const result = [];
|
|
13675
13477
|
const stack = [];
|
|
13676
13478
|
let start = 0;
|
|
13677
|
-
for (let i = 0; i <
|
|
13678
|
-
if (
|
|
13679
|
-
stack.push(
|
|
13680
|
-
} else if (
|
|
13479
|
+
for (let i = 0; i < s2.length; i++) {
|
|
13480
|
+
if (s2[i] === "{" || s2[i] === "[") {
|
|
13481
|
+
stack.push(s2[i] === "{" ? "}" : "]");
|
|
13482
|
+
} else if (s2[i] === stack[stack.length - 1]) {
|
|
13681
13483
|
stack.pop();
|
|
13682
|
-
} else if (!stack.length &&
|
|
13683
|
-
const token =
|
|
13484
|
+
} else if (!stack.length && s2[i] === ",") {
|
|
13485
|
+
const token = s2.substring(start, i).trim();
|
|
13684
13486
|
if (token) {
|
|
13685
13487
|
result.push(token);
|
|
13686
13488
|
}
|
|
13687
13489
|
start = i + 1;
|
|
13688
13490
|
}
|
|
13689
13491
|
}
|
|
13690
|
-
const lastToken =
|
|
13492
|
+
const lastToken = s2.substring(start).trim();
|
|
13691
13493
|
if (lastToken) {
|
|
13692
13494
|
result.push(lastToken);
|
|
13693
13495
|
}
|
|
@@ -13924,7 +13726,7 @@ function withAwaitAsyncAssertions(fn2, task) {
|
|
|
13924
13726
|
const fnResult = await fn2(...args);
|
|
13925
13727
|
if (task.promises) {
|
|
13926
13728
|
const result = await Promise.allSettled(task.promises);
|
|
13927
|
-
const errors = result.map((
|
|
13729
|
+
const errors = result.map((r2) => r2.status === "rejected" ? r2.reason : void 0).filter(Boolean);
|
|
13928
13730
|
if (errors.length) {
|
|
13929
13731
|
throw errors;
|
|
13930
13732
|
}
|
|
@@ -14167,7 +13969,7 @@ function getNames(task) {
|
|
|
14167
13969
|
return names;
|
|
14168
13970
|
}
|
|
14169
13971
|
globalThis.performance ? globalThis.performance.now.bind(globalThis.performance) : Date.now;
|
|
14170
|
-
|
|
13972
|
+
getSafeTimers();
|
|
14171
13973
|
var packs = /* @__PURE__ */ new Map();
|
|
14172
13974
|
var eventsPacks = [];
|
|
14173
13975
|
var pendingTasksUpdates = [];
|
|
@@ -14181,10 +13983,10 @@ function sendTasksUpdate(runner2) {
|
|
|
14181
13983
|
task[1]
|
|
14182
13984
|
];
|
|
14183
13985
|
});
|
|
14184
|
-
const
|
|
14185
|
-
if (
|
|
14186
|
-
pendingTasksUpdates.push(
|
|
14187
|
-
|
|
13986
|
+
const p3 = (_runner$onTaskUpdate = runner2.onTaskUpdate) === null || _runner$onTaskUpdate === void 0 ? void 0 : _runner$onTaskUpdate.call(runner2, taskPacks, eventsPacks);
|
|
13987
|
+
if (p3) {
|
|
13988
|
+
pendingTasksUpdates.push(p3);
|
|
13989
|
+
p3.then(() => pendingTasksUpdates.splice(pendingTasksUpdates.indexOf(p3), 1), () => {
|
|
14188
13990
|
});
|
|
14189
13991
|
}
|
|
14190
13992
|
eventsPacks.length = 0;
|
|
@@ -14213,7 +14015,7 @@ function withTimeout(fn2, timeout, isHook = false, stackTraceError, onTimeout) {
|
|
|
14213
14015
|
if (timeout <= 0 || timeout === Number.POSITIVE_INFINITY) {
|
|
14214
14016
|
return fn2;
|
|
14215
14017
|
}
|
|
14216
|
-
const { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } =
|
|
14018
|
+
const { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = getSafeTimers();
|
|
14217
14019
|
return function runWithTimeout(...args) {
|
|
14218
14020
|
const startTime = now();
|
|
14219
14021
|
const runner2 = getRunner();
|
|
@@ -14382,25 +14184,25 @@ function encodeUint8Array(bytes) {
|
|
|
14382
14184
|
const len = bytes.byteLength;
|
|
14383
14185
|
for (let i = 0; i < len; i += 3) {
|
|
14384
14186
|
if (len === i + 1) {
|
|
14385
|
-
const
|
|
14187
|
+
const a3 = (bytes[i] & 252) >> 2;
|
|
14386
14188
|
const b2 = (bytes[i] & 3) << 4;
|
|
14387
|
-
base64 += table[
|
|
14189
|
+
base64 += table[a3];
|
|
14388
14190
|
base64 += table[b2];
|
|
14389
14191
|
base64 += "==";
|
|
14390
14192
|
} else if (len === i + 2) {
|
|
14391
|
-
const
|
|
14193
|
+
const a3 = (bytes[i] & 252) >> 2;
|
|
14392
14194
|
const b2 = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
14393
14195
|
const c = (bytes[i + 1] & 15) << 2;
|
|
14394
|
-
base64 += table[
|
|
14196
|
+
base64 += table[a3];
|
|
14395
14197
|
base64 += table[b2];
|
|
14396
14198
|
base64 += table[c];
|
|
14397
14199
|
base64 += "=";
|
|
14398
14200
|
} else {
|
|
14399
|
-
const
|
|
14201
|
+
const a3 = (bytes[i] & 252) >> 2;
|
|
14400
14202
|
const b2 = (bytes[i] & 3) << 4 | (bytes[i + 1] & 240) >> 4;
|
|
14401
14203
|
const c = (bytes[i + 1] & 15) << 2 | (bytes[i + 2] & 192) >> 6;
|
|
14402
14204
|
const d = bytes[i + 2] & 63;
|
|
14403
|
-
base64 += table[
|
|
14205
|
+
base64 += table[a3];
|
|
14404
14206
|
base64 += table[b2];
|
|
14405
14207
|
base64 += table[c];
|
|
14406
14208
|
base64 += table[d];
|
|
@@ -14425,90 +14227,574 @@ function recordAsyncAnnotation(test5, promise) {
|
|
|
14425
14227
|
return promise;
|
|
14426
14228
|
}
|
|
14427
14229
|
|
|
14428
|
-
// ../../node_modules/vitest/dist/
|
|
14429
|
-
|
|
14430
|
-
|
|
14431
|
-
const
|
|
14432
|
-
|
|
14433
|
-
|
|
14434
|
-
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14439
|
-
|
|
14440
|
-
return state?.environment.name;
|
|
14441
|
-
}
|
|
14442
|
-
function isChildProcess() {
|
|
14443
|
-
return typeof process !== "undefined" && !!process.send;
|
|
14444
|
-
}
|
|
14445
|
-
function resetModules(modules, resetMocks = false) {
|
|
14446
|
-
const skipPaths = [
|
|
14447
|
-
/\/vitest\/dist\//,
|
|
14448
|
-
/\/vite-node\/dist\//,
|
|
14449
|
-
/vitest-virtual-\w+\/dist/,
|
|
14450
|
-
/@vitest\/dist/,
|
|
14451
|
-
...!resetMocks ? [/^mock:/] : []
|
|
14452
|
-
];
|
|
14453
|
-
modules.forEach((mod, path) => {
|
|
14454
|
-
if (skipPaths.some((re) => re.test(path))) return;
|
|
14455
|
-
modules.invalidateModule(mod);
|
|
14456
|
-
});
|
|
14457
|
-
}
|
|
14458
|
-
function waitNextTick() {
|
|
14459
|
-
const { setTimeout: setTimeout2 } = getSafeTimers();
|
|
14460
|
-
return new Promise((resolve5) => setTimeout2(resolve5, 0));
|
|
14230
|
+
// ../../node_modules/vitest/node_modules/@vitest/utils/dist/helpers.js
|
|
14231
|
+
function createSimpleStackTrace3(options) {
|
|
14232
|
+
const { message = "$$stack trace error", stackTraceLimit = 1 } = options || {};
|
|
14233
|
+
const limit = Error.stackTraceLimit;
|
|
14234
|
+
const prepareStackTrace = Error.prepareStackTrace;
|
|
14235
|
+
Error.stackTraceLimit = stackTraceLimit;
|
|
14236
|
+
Error.prepareStackTrace = (e) => e.stack;
|
|
14237
|
+
const err = new Error(message);
|
|
14238
|
+
const stackTrace = err.stack || "";
|
|
14239
|
+
Error.prepareStackTrace = prepareStackTrace;
|
|
14240
|
+
Error.stackTraceLimit = limit;
|
|
14241
|
+
return stackTrace;
|
|
14461
14242
|
}
|
|
14462
|
-
|
|
14463
|
-
|
|
14464
|
-
const
|
|
14465
|
-
|
|
14466
|
-
|
|
14467
|
-
for (const mod of state.moduleCache.values()) {
|
|
14468
|
-
if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
14469
|
-
if (mod.resolving) resolvingCount++;
|
|
14243
|
+
function assertTypes3(value, name, types) {
|
|
14244
|
+
const receivedType = typeof value;
|
|
14245
|
+
const pass = types.includes(receivedType);
|
|
14246
|
+
if (!pass) {
|
|
14247
|
+
throw new TypeError(`${name} value must be ${types.join(" or ")}, received "${receivedType}"`);
|
|
14470
14248
|
}
|
|
14471
|
-
if (!promises.length && !resolvingCount) return;
|
|
14472
|
-
await Promise.allSettled(promises);
|
|
14473
|
-
await waitForImportsToResolve();
|
|
14474
|
-
}
|
|
14475
|
-
|
|
14476
|
-
// ../../node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
14477
|
-
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
14478
|
-
function getDefaultExportFromCjs3(x2) {
|
|
14479
|
-
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
14480
14249
|
}
|
|
14481
14250
|
|
|
14482
|
-
// ../../node_modules/@vitest/
|
|
14483
|
-
var
|
|
14484
|
-
var
|
|
14485
|
-
|
|
14486
|
-
|
|
14487
|
-
|
|
14488
|
-
|
|
14489
|
-
|
|
14490
|
-
|
|
14491
|
-
}
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
}
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14251
|
+
// ../../node_modules/vitest/node_modules/@vitest/utils/dist/index.js
|
|
14252
|
+
var jsTokens_13;
|
|
14253
|
+
var hasRequiredJsTokens3;
|
|
14254
|
+
function requireJsTokens3() {
|
|
14255
|
+
if (hasRequiredJsTokens3) return jsTokens_13;
|
|
14256
|
+
hasRequiredJsTokens3 = 1;
|
|
14257
|
+
var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
|
14258
|
+
RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
|
|
14259
|
+
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
|
|
14260
|
+
Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
|
|
14261
|
+
StringLiteral = /(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y;
|
|
14262
|
+
NumericLiteral = /(?:0[xX][\da-fA-F](?:_?[\da-fA-F])*|0[oO][0-7](?:_?[0-7])*|0[bB][01](?:_?[01])*)n?|0n|[1-9](?:_?\d)*n|(?:(?:0(?!\d)|0\d*[89]\d*|[1-9](?:_?\d)*)(?:\.(?:\d(?:_?\d)*)?)?|\.\d(?:_?\d)*)(?:[eE][+-]?\d(?:_?\d)*)?|0[0-7]+/y;
|
|
14263
|
+
Template = /[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y;
|
|
14264
|
+
WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
|
|
14265
|
+
LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
|
|
14266
|
+
MultiLineComment = /\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y;
|
|
14267
|
+
SingleLineComment = /\/\/.*/y;
|
|
14268
|
+
JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
|
|
14269
|
+
JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
|
|
14270
|
+
JSXString = /(['"])(?:(?!\1)[^])*(\1)?/y;
|
|
14271
|
+
JSXText = /[^<>{}]+/y;
|
|
14272
|
+
TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
|
|
14273
|
+
TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
|
|
14274
|
+
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
|
|
14275
|
+
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
|
|
14276
|
+
Newline = RegExp(LineTerminatorSequence.source);
|
|
14277
|
+
jsTokens_13 = function* (input, { jsx = false } = {}) {
|
|
14278
|
+
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
|
|
14279
|
+
({ length } = input);
|
|
14280
|
+
lastIndex = 0;
|
|
14281
|
+
lastSignificantToken = "";
|
|
14282
|
+
stack = [
|
|
14283
|
+
{ tag: "JS" }
|
|
14284
|
+
];
|
|
14285
|
+
braces = [];
|
|
14286
|
+
parenNesting = 0;
|
|
14287
|
+
postfixIncDec = false;
|
|
14288
|
+
while (lastIndex < length) {
|
|
14289
|
+
mode = stack[stack.length - 1];
|
|
14290
|
+
switch (mode.tag) {
|
|
14291
|
+
case "JS":
|
|
14292
|
+
case "JSNonExpressionParen":
|
|
14293
|
+
case "InterpolationInTemplate":
|
|
14294
|
+
case "InterpolationInJSX":
|
|
14295
|
+
if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
14296
|
+
RegularExpressionLiteral.lastIndex = lastIndex;
|
|
14297
|
+
if (match = RegularExpressionLiteral.exec(input)) {
|
|
14298
|
+
lastIndex = RegularExpressionLiteral.lastIndex;
|
|
14299
|
+
lastSignificantToken = match[0];
|
|
14300
|
+
postfixIncDec = true;
|
|
14301
|
+
yield {
|
|
14302
|
+
type: "RegularExpressionLiteral",
|
|
14303
|
+
value: match[0],
|
|
14304
|
+
closed: match[1] !== void 0 && match[1] !== "\\"
|
|
14305
|
+
};
|
|
14306
|
+
continue;
|
|
14307
|
+
}
|
|
14308
|
+
}
|
|
14309
|
+
Punctuator.lastIndex = lastIndex;
|
|
14310
|
+
if (match = Punctuator.exec(input)) {
|
|
14311
|
+
punctuator = match[0];
|
|
14312
|
+
nextLastIndex = Punctuator.lastIndex;
|
|
14313
|
+
nextLastSignificantToken = punctuator;
|
|
14314
|
+
switch (punctuator) {
|
|
14315
|
+
case "(":
|
|
14316
|
+
if (lastSignificantToken === "?NonExpressionParenKeyword") {
|
|
14317
|
+
stack.push({
|
|
14318
|
+
tag: "JSNonExpressionParen",
|
|
14319
|
+
nesting: parenNesting
|
|
14320
|
+
});
|
|
14321
|
+
}
|
|
14322
|
+
parenNesting++;
|
|
14323
|
+
postfixIncDec = false;
|
|
14324
|
+
break;
|
|
14325
|
+
case ")":
|
|
14326
|
+
parenNesting--;
|
|
14327
|
+
postfixIncDec = true;
|
|
14328
|
+
if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
|
|
14329
|
+
stack.pop();
|
|
14330
|
+
nextLastSignificantToken = "?NonExpressionParenEnd";
|
|
14331
|
+
postfixIncDec = false;
|
|
14332
|
+
}
|
|
14333
|
+
break;
|
|
14334
|
+
case "{":
|
|
14335
|
+
Punctuator.lastIndex = 0;
|
|
14336
|
+
isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
|
|
14337
|
+
braces.push(isExpression);
|
|
14338
|
+
postfixIncDec = false;
|
|
14339
|
+
break;
|
|
14340
|
+
case "}":
|
|
14341
|
+
switch (mode.tag) {
|
|
14342
|
+
case "InterpolationInTemplate":
|
|
14343
|
+
if (braces.length === mode.nesting) {
|
|
14344
|
+
Template.lastIndex = lastIndex;
|
|
14345
|
+
match = Template.exec(input);
|
|
14346
|
+
lastIndex = Template.lastIndex;
|
|
14347
|
+
lastSignificantToken = match[0];
|
|
14348
|
+
if (match[1] === "${") {
|
|
14349
|
+
lastSignificantToken = "?InterpolationInTemplate";
|
|
14350
|
+
postfixIncDec = false;
|
|
14351
|
+
yield {
|
|
14352
|
+
type: "TemplateMiddle",
|
|
14353
|
+
value: match[0]
|
|
14354
|
+
};
|
|
14355
|
+
} else {
|
|
14356
|
+
stack.pop();
|
|
14357
|
+
postfixIncDec = true;
|
|
14358
|
+
yield {
|
|
14359
|
+
type: "TemplateTail",
|
|
14360
|
+
value: match[0],
|
|
14361
|
+
closed: match[1] === "`"
|
|
14362
|
+
};
|
|
14363
|
+
}
|
|
14364
|
+
continue;
|
|
14365
|
+
}
|
|
14366
|
+
break;
|
|
14367
|
+
case "InterpolationInJSX":
|
|
14368
|
+
if (braces.length === mode.nesting) {
|
|
14369
|
+
stack.pop();
|
|
14370
|
+
lastIndex += 1;
|
|
14371
|
+
lastSignificantToken = "}";
|
|
14372
|
+
yield {
|
|
14373
|
+
type: "JSXPunctuator",
|
|
14374
|
+
value: "}"
|
|
14375
|
+
};
|
|
14376
|
+
continue;
|
|
14377
|
+
}
|
|
14378
|
+
}
|
|
14379
|
+
postfixIncDec = braces.pop();
|
|
14380
|
+
nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
|
|
14381
|
+
break;
|
|
14382
|
+
case "]":
|
|
14383
|
+
postfixIncDec = true;
|
|
14384
|
+
break;
|
|
14385
|
+
case "++":
|
|
14386
|
+
case "--":
|
|
14387
|
+
nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
|
|
14388
|
+
break;
|
|
14389
|
+
case "<":
|
|
14390
|
+
if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
|
|
14391
|
+
stack.push({ tag: "JSXTag" });
|
|
14392
|
+
lastIndex += 1;
|
|
14393
|
+
lastSignificantToken = "<";
|
|
14394
|
+
yield {
|
|
14395
|
+
type: "JSXPunctuator",
|
|
14396
|
+
value: punctuator
|
|
14397
|
+
};
|
|
14398
|
+
continue;
|
|
14399
|
+
}
|
|
14400
|
+
postfixIncDec = false;
|
|
14401
|
+
break;
|
|
14402
|
+
default:
|
|
14403
|
+
postfixIncDec = false;
|
|
14404
|
+
}
|
|
14405
|
+
lastIndex = nextLastIndex;
|
|
14406
|
+
lastSignificantToken = nextLastSignificantToken;
|
|
14407
|
+
yield {
|
|
14408
|
+
type: "Punctuator",
|
|
14409
|
+
value: punctuator
|
|
14410
|
+
};
|
|
14411
|
+
continue;
|
|
14412
|
+
}
|
|
14413
|
+
Identifier.lastIndex = lastIndex;
|
|
14414
|
+
if (match = Identifier.exec(input)) {
|
|
14415
|
+
lastIndex = Identifier.lastIndex;
|
|
14416
|
+
nextLastSignificantToken = match[0];
|
|
14417
|
+
switch (match[0]) {
|
|
14418
|
+
case "for":
|
|
14419
|
+
case "if":
|
|
14420
|
+
case "while":
|
|
14421
|
+
case "with":
|
|
14422
|
+
if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
|
|
14423
|
+
nextLastSignificantToken = "?NonExpressionParenKeyword";
|
|
14424
|
+
}
|
|
14425
|
+
}
|
|
14426
|
+
lastSignificantToken = nextLastSignificantToken;
|
|
14427
|
+
postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
|
|
14428
|
+
yield {
|
|
14429
|
+
type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
|
|
14430
|
+
value: match[0]
|
|
14431
|
+
};
|
|
14432
|
+
continue;
|
|
14433
|
+
}
|
|
14434
|
+
StringLiteral.lastIndex = lastIndex;
|
|
14435
|
+
if (match = StringLiteral.exec(input)) {
|
|
14436
|
+
lastIndex = StringLiteral.lastIndex;
|
|
14437
|
+
lastSignificantToken = match[0];
|
|
14438
|
+
postfixIncDec = true;
|
|
14439
|
+
yield {
|
|
14440
|
+
type: "StringLiteral",
|
|
14441
|
+
value: match[0],
|
|
14442
|
+
closed: match[2] !== void 0
|
|
14443
|
+
};
|
|
14444
|
+
continue;
|
|
14445
|
+
}
|
|
14446
|
+
NumericLiteral.lastIndex = lastIndex;
|
|
14447
|
+
if (match = NumericLiteral.exec(input)) {
|
|
14448
|
+
lastIndex = NumericLiteral.lastIndex;
|
|
14449
|
+
lastSignificantToken = match[0];
|
|
14450
|
+
postfixIncDec = true;
|
|
14451
|
+
yield {
|
|
14452
|
+
type: "NumericLiteral",
|
|
14453
|
+
value: match[0]
|
|
14454
|
+
};
|
|
14455
|
+
continue;
|
|
14456
|
+
}
|
|
14457
|
+
Template.lastIndex = lastIndex;
|
|
14458
|
+
if (match = Template.exec(input)) {
|
|
14459
|
+
lastIndex = Template.lastIndex;
|
|
14460
|
+
lastSignificantToken = match[0];
|
|
14461
|
+
if (match[1] === "${") {
|
|
14462
|
+
lastSignificantToken = "?InterpolationInTemplate";
|
|
14463
|
+
stack.push({
|
|
14464
|
+
tag: "InterpolationInTemplate",
|
|
14465
|
+
nesting: braces.length
|
|
14466
|
+
});
|
|
14467
|
+
postfixIncDec = false;
|
|
14468
|
+
yield {
|
|
14469
|
+
type: "TemplateHead",
|
|
14470
|
+
value: match[0]
|
|
14471
|
+
};
|
|
14472
|
+
} else {
|
|
14473
|
+
postfixIncDec = true;
|
|
14474
|
+
yield {
|
|
14475
|
+
type: "NoSubstitutionTemplate",
|
|
14476
|
+
value: match[0],
|
|
14477
|
+
closed: match[1] === "`"
|
|
14478
|
+
};
|
|
14479
|
+
}
|
|
14480
|
+
continue;
|
|
14481
|
+
}
|
|
14482
|
+
break;
|
|
14483
|
+
case "JSXTag":
|
|
14484
|
+
case "JSXTagEnd":
|
|
14485
|
+
JSXPunctuator.lastIndex = lastIndex;
|
|
14486
|
+
if (match = JSXPunctuator.exec(input)) {
|
|
14487
|
+
lastIndex = JSXPunctuator.lastIndex;
|
|
14488
|
+
nextLastSignificantToken = match[0];
|
|
14489
|
+
switch (match[0]) {
|
|
14490
|
+
case "<":
|
|
14491
|
+
stack.push({ tag: "JSXTag" });
|
|
14492
|
+
break;
|
|
14493
|
+
case ">":
|
|
14494
|
+
stack.pop();
|
|
14495
|
+
if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
|
|
14496
|
+
nextLastSignificantToken = "?JSX";
|
|
14497
|
+
postfixIncDec = true;
|
|
14498
|
+
} else {
|
|
14499
|
+
stack.push({ tag: "JSXChildren" });
|
|
14500
|
+
}
|
|
14501
|
+
break;
|
|
14502
|
+
case "{":
|
|
14503
|
+
stack.push({
|
|
14504
|
+
tag: "InterpolationInJSX",
|
|
14505
|
+
nesting: braces.length
|
|
14506
|
+
});
|
|
14507
|
+
nextLastSignificantToken = "?InterpolationInJSX";
|
|
14508
|
+
postfixIncDec = false;
|
|
14509
|
+
break;
|
|
14510
|
+
case "/":
|
|
14511
|
+
if (lastSignificantToken === "<") {
|
|
14512
|
+
stack.pop();
|
|
14513
|
+
if (stack[stack.length - 1].tag === "JSXChildren") {
|
|
14514
|
+
stack.pop();
|
|
14515
|
+
}
|
|
14516
|
+
stack.push({ tag: "JSXTagEnd" });
|
|
14517
|
+
}
|
|
14518
|
+
}
|
|
14519
|
+
lastSignificantToken = nextLastSignificantToken;
|
|
14520
|
+
yield {
|
|
14521
|
+
type: "JSXPunctuator",
|
|
14522
|
+
value: match[0]
|
|
14523
|
+
};
|
|
14524
|
+
continue;
|
|
14525
|
+
}
|
|
14526
|
+
JSXIdentifier.lastIndex = lastIndex;
|
|
14527
|
+
if (match = JSXIdentifier.exec(input)) {
|
|
14528
|
+
lastIndex = JSXIdentifier.lastIndex;
|
|
14529
|
+
lastSignificantToken = match[0];
|
|
14530
|
+
yield {
|
|
14531
|
+
type: "JSXIdentifier",
|
|
14532
|
+
value: match[0]
|
|
14533
|
+
};
|
|
14534
|
+
continue;
|
|
14535
|
+
}
|
|
14536
|
+
JSXString.lastIndex = lastIndex;
|
|
14537
|
+
if (match = JSXString.exec(input)) {
|
|
14538
|
+
lastIndex = JSXString.lastIndex;
|
|
14539
|
+
lastSignificantToken = match[0];
|
|
14540
|
+
yield {
|
|
14541
|
+
type: "JSXString",
|
|
14542
|
+
value: match[0],
|
|
14543
|
+
closed: match[2] !== void 0
|
|
14544
|
+
};
|
|
14545
|
+
continue;
|
|
14546
|
+
}
|
|
14547
|
+
break;
|
|
14548
|
+
case "JSXChildren":
|
|
14549
|
+
JSXText.lastIndex = lastIndex;
|
|
14550
|
+
if (match = JSXText.exec(input)) {
|
|
14551
|
+
lastIndex = JSXText.lastIndex;
|
|
14552
|
+
lastSignificantToken = match[0];
|
|
14553
|
+
yield {
|
|
14554
|
+
type: "JSXText",
|
|
14555
|
+
value: match[0]
|
|
14556
|
+
};
|
|
14557
|
+
continue;
|
|
14558
|
+
}
|
|
14559
|
+
switch (input[lastIndex]) {
|
|
14560
|
+
case "<":
|
|
14561
|
+
stack.push({ tag: "JSXTag" });
|
|
14562
|
+
lastIndex++;
|
|
14563
|
+
lastSignificantToken = "<";
|
|
14564
|
+
yield {
|
|
14565
|
+
type: "JSXPunctuator",
|
|
14566
|
+
value: "<"
|
|
14567
|
+
};
|
|
14568
|
+
continue;
|
|
14569
|
+
case "{":
|
|
14570
|
+
stack.push({
|
|
14571
|
+
tag: "InterpolationInJSX",
|
|
14572
|
+
nesting: braces.length
|
|
14573
|
+
});
|
|
14574
|
+
lastIndex++;
|
|
14575
|
+
lastSignificantToken = "?InterpolationInJSX";
|
|
14576
|
+
postfixIncDec = false;
|
|
14577
|
+
yield {
|
|
14578
|
+
type: "JSXPunctuator",
|
|
14579
|
+
value: "{"
|
|
14580
|
+
};
|
|
14581
|
+
continue;
|
|
14582
|
+
}
|
|
14583
|
+
}
|
|
14584
|
+
WhiteSpace.lastIndex = lastIndex;
|
|
14585
|
+
if (match = WhiteSpace.exec(input)) {
|
|
14586
|
+
lastIndex = WhiteSpace.lastIndex;
|
|
14587
|
+
yield {
|
|
14588
|
+
type: "WhiteSpace",
|
|
14589
|
+
value: match[0]
|
|
14590
|
+
};
|
|
14591
|
+
continue;
|
|
14592
|
+
}
|
|
14593
|
+
LineTerminatorSequence.lastIndex = lastIndex;
|
|
14594
|
+
if (match = LineTerminatorSequence.exec(input)) {
|
|
14595
|
+
lastIndex = LineTerminatorSequence.lastIndex;
|
|
14596
|
+
postfixIncDec = false;
|
|
14597
|
+
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
|
|
14598
|
+
lastSignificantToken = "?NoLineTerminatorHere";
|
|
14599
|
+
}
|
|
14600
|
+
yield {
|
|
14601
|
+
type: "LineTerminatorSequence",
|
|
14602
|
+
value: match[0]
|
|
14603
|
+
};
|
|
14604
|
+
continue;
|
|
14605
|
+
}
|
|
14606
|
+
MultiLineComment.lastIndex = lastIndex;
|
|
14607
|
+
if (match = MultiLineComment.exec(input)) {
|
|
14608
|
+
lastIndex = MultiLineComment.lastIndex;
|
|
14609
|
+
if (Newline.test(match[0])) {
|
|
14610
|
+
postfixIncDec = false;
|
|
14611
|
+
if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
|
|
14612
|
+
lastSignificantToken = "?NoLineTerminatorHere";
|
|
14613
|
+
}
|
|
14614
|
+
}
|
|
14615
|
+
yield {
|
|
14616
|
+
type: "MultiLineComment",
|
|
14617
|
+
value: match[0],
|
|
14618
|
+
closed: match[1] !== void 0
|
|
14619
|
+
};
|
|
14620
|
+
continue;
|
|
14621
|
+
}
|
|
14622
|
+
SingleLineComment.lastIndex = lastIndex;
|
|
14623
|
+
if (match = SingleLineComment.exec(input)) {
|
|
14624
|
+
lastIndex = SingleLineComment.lastIndex;
|
|
14625
|
+
postfixIncDec = false;
|
|
14626
|
+
yield {
|
|
14627
|
+
type: "SingleLineComment",
|
|
14628
|
+
value: match[0]
|
|
14629
|
+
};
|
|
14630
|
+
continue;
|
|
14631
|
+
}
|
|
14632
|
+
firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
|
|
14633
|
+
lastIndex += firstCodePoint.length;
|
|
14634
|
+
lastSignificantToken = firstCodePoint;
|
|
14635
|
+
postfixIncDec = false;
|
|
14636
|
+
yield {
|
|
14637
|
+
type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
|
|
14638
|
+
value: firstCodePoint
|
|
14639
|
+
};
|
|
14640
|
+
}
|
|
14641
|
+
return void 0;
|
|
14642
|
+
};
|
|
14643
|
+
return jsTokens_13;
|
|
14644
|
+
}
|
|
14645
|
+
requireJsTokens3();
|
|
14646
|
+
var reservedWords3 = {
|
|
14647
|
+
keyword: [
|
|
14648
|
+
"break",
|
|
14649
|
+
"case",
|
|
14650
|
+
"catch",
|
|
14651
|
+
"continue",
|
|
14652
|
+
"debugger",
|
|
14653
|
+
"default",
|
|
14654
|
+
"do",
|
|
14655
|
+
"else",
|
|
14656
|
+
"finally",
|
|
14657
|
+
"for",
|
|
14658
|
+
"function",
|
|
14659
|
+
"if",
|
|
14660
|
+
"return",
|
|
14661
|
+
"switch",
|
|
14662
|
+
"throw",
|
|
14663
|
+
"try",
|
|
14664
|
+
"var",
|
|
14665
|
+
"const",
|
|
14666
|
+
"while",
|
|
14667
|
+
"with",
|
|
14668
|
+
"new",
|
|
14669
|
+
"this",
|
|
14670
|
+
"super",
|
|
14671
|
+
"class",
|
|
14672
|
+
"extends",
|
|
14673
|
+
"export",
|
|
14674
|
+
"import",
|
|
14675
|
+
"null",
|
|
14676
|
+
"true",
|
|
14677
|
+
"false",
|
|
14678
|
+
"in",
|
|
14679
|
+
"instanceof",
|
|
14680
|
+
"typeof",
|
|
14681
|
+
"void",
|
|
14682
|
+
"delete"
|
|
14683
|
+
],
|
|
14684
|
+
strict: [
|
|
14685
|
+
"implements",
|
|
14686
|
+
"interface",
|
|
14687
|
+
"let",
|
|
14688
|
+
"package",
|
|
14689
|
+
"private",
|
|
14690
|
+
"protected",
|
|
14691
|
+
"public",
|
|
14692
|
+
"static",
|
|
14693
|
+
"yield"
|
|
14694
|
+
]
|
|
14695
|
+
};
|
|
14696
|
+
new Set(reservedWords3.keyword);
|
|
14697
|
+
new Set(reservedWords3.strict);
|
|
14698
|
+
var SAFE_TIMERS_SYMBOL2 = /* @__PURE__ */ Symbol("vitest:SAFE_TIMERS");
|
|
14699
|
+
function getSafeTimers2() {
|
|
14700
|
+
const { setTimeout: safeSetTimeout, setInterval: safeSetInterval, clearInterval: safeClearInterval, clearTimeout: safeClearTimeout, setImmediate: safeSetImmediate, clearImmediate: safeClearImmediate, queueMicrotask: safeQueueMicrotask } = globalThis[SAFE_TIMERS_SYMBOL2] || globalThis;
|
|
14701
|
+
const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL2] || globalThis.process || { nextTick: (cb) => cb() };
|
|
14702
|
+
return {
|
|
14703
|
+
nextTick: safeNextTick,
|
|
14704
|
+
setTimeout: safeSetTimeout,
|
|
14705
|
+
setInterval: safeSetInterval,
|
|
14706
|
+
clearInterval: safeClearInterval,
|
|
14707
|
+
clearTimeout: safeClearTimeout,
|
|
14708
|
+
setImmediate: safeSetImmediate,
|
|
14709
|
+
clearImmediate: safeClearImmediate,
|
|
14710
|
+
queueMicrotask: safeQueueMicrotask
|
|
14711
|
+
};
|
|
14712
|
+
}
|
|
14713
|
+
|
|
14714
|
+
// ../../node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
14715
|
+
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
14716
|
+
function getWorkerState() {
|
|
14717
|
+
const workerState = globalThis[NAME_WORKER_STATE];
|
|
14718
|
+
if (!workerState) {
|
|
14719
|
+
const errorMsg = 'Vitest failed to access its internal state.\n\nOne of the following is possible:\n- "vitest" is imported directly without running "vitest" command\n- "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)\n- "vitest" is imported inside Vite / Vitest config file\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n';
|
|
14720
|
+
throw new Error(errorMsg);
|
|
14721
|
+
}
|
|
14722
|
+
return workerState;
|
|
14723
|
+
}
|
|
14724
|
+
function getCurrentEnvironment() {
|
|
14725
|
+
const state = getWorkerState();
|
|
14726
|
+
return state?.environment.name;
|
|
14727
|
+
}
|
|
14728
|
+
function isChildProcess() {
|
|
14729
|
+
return typeof process !== "undefined" && !!process.send;
|
|
14730
|
+
}
|
|
14731
|
+
function resetModules(modules, resetMocks = false) {
|
|
14732
|
+
const skipPaths = [
|
|
14733
|
+
/\/vitest\/dist\//,
|
|
14734
|
+
/\/vite-node\/dist\//,
|
|
14735
|
+
/vitest-virtual-\w+\/dist/,
|
|
14736
|
+
/@vitest\/dist/,
|
|
14737
|
+
...!resetMocks ? [/^mock:/] : []
|
|
14738
|
+
];
|
|
14739
|
+
modules.forEach((mod, path) => {
|
|
14740
|
+
if (skipPaths.some((re) => re.test(path))) return;
|
|
14741
|
+
modules.invalidateModule(mod);
|
|
14742
|
+
});
|
|
14743
|
+
}
|
|
14744
|
+
function waitNextTick() {
|
|
14745
|
+
const { setTimeout: setTimeout2 } = getSafeTimers2();
|
|
14746
|
+
return new Promise((resolve5) => setTimeout2(resolve5, 0));
|
|
14747
|
+
}
|
|
14748
|
+
async function waitForImportsToResolve() {
|
|
14749
|
+
await waitNextTick();
|
|
14750
|
+
const state = getWorkerState();
|
|
14751
|
+
const promises = [];
|
|
14752
|
+
let resolvingCount = 0;
|
|
14753
|
+
for (const mod of state.moduleCache.values()) {
|
|
14754
|
+
if (mod.promise && !mod.evaluated) promises.push(mod.promise);
|
|
14755
|
+
if (mod.resolving) resolvingCount++;
|
|
14756
|
+
}
|
|
14757
|
+
if (!promises.length && !resolvingCount) return;
|
|
14758
|
+
await Promise.allSettled(promises);
|
|
14759
|
+
await waitForImportsToResolve();
|
|
14760
|
+
}
|
|
14761
|
+
|
|
14762
|
+
// ../../node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
14763
|
+
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
14764
|
+
function getDefaultExportFromCjs3(x2) {
|
|
14765
|
+
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
14766
|
+
}
|
|
14767
|
+
|
|
14768
|
+
// ../../node_modules/@vitest/snapshot/dist/index.js
|
|
14769
|
+
var comma3 = ",".charCodeAt(0);
|
|
14770
|
+
var chars3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
14771
|
+
var intToChar3 = new Uint8Array(64);
|
|
14772
|
+
var charToInt3 = new Uint8Array(128);
|
|
14773
|
+
for (let i = 0; i < chars3.length; i++) {
|
|
14774
|
+
const c = chars3.charCodeAt(i);
|
|
14775
|
+
intToChar3[i] = c;
|
|
14776
|
+
charToInt3[c] = i;
|
|
14777
|
+
}
|
|
14778
|
+
function decodeInteger(reader, relative2) {
|
|
14779
|
+
let value = 0;
|
|
14780
|
+
let shift = 0;
|
|
14781
|
+
let integer = 0;
|
|
14782
|
+
do {
|
|
14783
|
+
const c = reader.next();
|
|
14784
|
+
integer = charToInt3[c];
|
|
14785
|
+
value |= (integer & 31) << shift;
|
|
14786
|
+
shift += 5;
|
|
14787
|
+
} while (integer & 32);
|
|
14788
|
+
const shouldNegate = value & 1;
|
|
14789
|
+
value >>>= 1;
|
|
14790
|
+
if (shouldNegate) {
|
|
14791
|
+
value = -2147483648 | -value;
|
|
14792
|
+
}
|
|
14793
|
+
return relative2 + value;
|
|
14794
|
+
}
|
|
14795
|
+
function hasMoreVlq(reader, max) {
|
|
14796
|
+
if (reader.pos >= max)
|
|
14797
|
+
return false;
|
|
14512
14798
|
return reader.peek() !== comma3;
|
|
14513
14799
|
}
|
|
14514
14800
|
var StringReader = class {
|
|
@@ -14575,8 +14861,8 @@ function decode(mappings) {
|
|
|
14575
14861
|
function sort(line) {
|
|
14576
14862
|
line.sort(sortComparator$1);
|
|
14577
14863
|
}
|
|
14578
|
-
function sortComparator$1(
|
|
14579
|
-
return
|
|
14864
|
+
function sortComparator$1(a3, b2) {
|
|
14865
|
+
return a3[0] - b2[0];
|
|
14580
14866
|
}
|
|
14581
14867
|
var schemeRegex = /^[\w+.-]+:\/\//;
|
|
14582
14868
|
var urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/;
|
|
@@ -14802,8 +15088,8 @@ function sortSegments(line, owned) {
|
|
|
14802
15088
|
line = line.slice();
|
|
14803
15089
|
return line.sort(sortComparator);
|
|
14804
15090
|
}
|
|
14805
|
-
function sortComparator(
|
|
14806
|
-
return
|
|
15091
|
+
function sortComparator(a3, b2) {
|
|
15092
|
+
return a3[COLUMN] - b2[COLUMN];
|
|
14807
15093
|
}
|
|
14808
15094
|
var found = false;
|
|
14809
15095
|
function binarySearch(haystack, needle, low, high) {
|
|
@@ -14882,7 +15168,7 @@ var TraceMap = class {
|
|
|
14882
15168
|
this.sourcesContent = sourcesContent;
|
|
14883
15169
|
this.ignoreList = parsed.ignoreList || parsed.x_google_ignoreList || void 0;
|
|
14884
15170
|
const from = resolve3(sourceRoot || "", stripFilename(mapUrl));
|
|
14885
|
-
this.resolvedSources = sources.map((
|
|
15171
|
+
this.resolvedSources = sources.map((s2) => resolve3(s2 || "", from));
|
|
14886
15172
|
const { mappings } = parsed;
|
|
14887
15173
|
if (typeof mappings === "string") {
|
|
14888
15174
|
this._encoded = mappings;
|
|
@@ -14936,16 +15222,16 @@ function traceSegmentInternal(segments, memo, line, column, bias) {
|
|
|
14936
15222
|
return -1;
|
|
14937
15223
|
return index2;
|
|
14938
15224
|
}
|
|
14939
|
-
function
|
|
15225
|
+
function notNullish4(v2) {
|
|
14940
15226
|
return v2 != null;
|
|
14941
15227
|
}
|
|
14942
|
-
function
|
|
15228
|
+
function isPrimitive5(value) {
|
|
14943
15229
|
return value === null || typeof value !== "function" && typeof value !== "object";
|
|
14944
15230
|
}
|
|
14945
|
-
function
|
|
15231
|
+
function isObject5(item) {
|
|
14946
15232
|
return item != null && typeof item === "object" && !Array.isArray(item);
|
|
14947
15233
|
}
|
|
14948
|
-
function
|
|
15234
|
+
function getCallLastIndex4(code) {
|
|
14949
15235
|
let charIndex = -1;
|
|
14950
15236
|
let inString = null;
|
|
14951
15237
|
let startedBracers = 0;
|
|
@@ -15122,19 +15408,19 @@ function parseStacktrace(stack, options = {}) {
|
|
|
15122
15408
|
};
|
|
15123
15409
|
}
|
|
15124
15410
|
return stack2;
|
|
15125
|
-
}).filter((
|
|
15411
|
+
}).filter((s2) => s2 != null);
|
|
15126
15412
|
}
|
|
15127
15413
|
function shouldFilter(ignoreStackEntries, file) {
|
|
15128
|
-
return ignoreStackEntries.some((
|
|
15414
|
+
return ignoreStackEntries.some((p3) => file.match(p3));
|
|
15129
15415
|
}
|
|
15130
15416
|
function parseFFOrSafariStackTrace(stack) {
|
|
15131
|
-
return stack.split("\n").map((line) => parseSingleFFOrSafariStack2(line)).filter(
|
|
15417
|
+
return stack.split("\n").map((line) => parseSingleFFOrSafariStack2(line)).filter(notNullish4);
|
|
15132
15418
|
}
|
|
15133
15419
|
function parseV8Stacktrace(stack) {
|
|
15134
|
-
return stack.split("\n").map((line) => parseSingleV8Stack2(line)).filter(
|
|
15420
|
+
return stack.split("\n").map((line) => parseSingleV8Stack2(line)).filter(notNullish4);
|
|
15135
15421
|
}
|
|
15136
15422
|
function parseErrorStacktrace(e, options = {}) {
|
|
15137
|
-
if (!e ||
|
|
15423
|
+
if (!e || isPrimitive5(e)) {
|
|
15138
15424
|
return [];
|
|
15139
15425
|
}
|
|
15140
15426
|
if (e.stacks) {
|
|
@@ -15152,7 +15438,7 @@ function parseErrorStacktrace(e, options = {}) {
|
|
|
15152
15438
|
}
|
|
15153
15439
|
}
|
|
15154
15440
|
if (options.frameFilter) {
|
|
15155
|
-
stackFrames = stackFrames.filter((
|
|
15441
|
+
stackFrames = stackFrames.filter((f4) => options.frameFilter(e, f4) !== false);
|
|
15156
15442
|
}
|
|
15157
15443
|
e.stacks = stackFrames;
|
|
15158
15444
|
return stackFrames;
|
|
@@ -15174,11 +15460,11 @@ try {
|
|
|
15174
15460
|
function getDefaultExportFromCjs4(x2) {
|
|
15175
15461
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
15176
15462
|
}
|
|
15177
|
-
var
|
|
15178
|
-
var
|
|
15179
|
-
function
|
|
15180
|
-
if (
|
|
15181
|
-
|
|
15463
|
+
var jsTokens_14;
|
|
15464
|
+
var hasRequiredJsTokens4;
|
|
15465
|
+
function requireJsTokens4() {
|
|
15466
|
+
if (hasRequiredJsTokens4) return jsTokens_14;
|
|
15467
|
+
hasRequiredJsTokens4 = 1;
|
|
15182
15468
|
var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
|
|
15183
15469
|
RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
|
|
15184
15470
|
Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
|
|
@@ -15199,7 +15485,7 @@ function requireJsTokens3() {
|
|
|
15199
15485
|
KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
|
|
15200
15486
|
KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
|
|
15201
15487
|
Newline = RegExp(LineTerminatorSequence.source);
|
|
15202
|
-
|
|
15488
|
+
jsTokens_14 = function* (input, { jsx = false } = {}) {
|
|
15203
15489
|
var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
|
|
15204
15490
|
({ length } = input);
|
|
15205
15491
|
lastIndex = 0;
|
|
@@ -15565,10 +15851,10 @@ function requireJsTokens3() {
|
|
|
15565
15851
|
}
|
|
15566
15852
|
return void 0;
|
|
15567
15853
|
};
|
|
15568
|
-
return
|
|
15854
|
+
return jsTokens_14;
|
|
15569
15855
|
}
|
|
15570
|
-
|
|
15571
|
-
var
|
|
15856
|
+
requireJsTokens4();
|
|
15857
|
+
var reservedWords4 = {
|
|
15572
15858
|
keyword: [
|
|
15573
15859
|
"break",
|
|
15574
15860
|
"case",
|
|
@@ -15618,9 +15904,9 @@ var reservedWords3 = {
|
|
|
15618
15904
|
"yield"
|
|
15619
15905
|
]
|
|
15620
15906
|
};
|
|
15621
|
-
new Set(
|
|
15622
|
-
new Set(
|
|
15623
|
-
var
|
|
15907
|
+
new Set(reservedWords4.keyword);
|
|
15908
|
+
new Set(reservedWords4.strict);
|
|
15909
|
+
var f3 = {
|
|
15624
15910
|
reset: [0, 0],
|
|
15625
15911
|
bold: [1, 22, "\x1B[22m\x1B[1m"],
|
|
15626
15912
|
dim: [2, 22, "\x1B[22m\x1B[2m"],
|
|
@@ -15663,41 +15949,41 @@ var f5 = {
|
|
|
15663
15949
|
bgCyanBright: [106, 49],
|
|
15664
15950
|
bgWhiteBright: [107, 49]
|
|
15665
15951
|
};
|
|
15666
|
-
var
|
|
15667
|
-
function
|
|
15952
|
+
var h3 = Object.entries(f3);
|
|
15953
|
+
function a2(n2) {
|
|
15668
15954
|
return String(n2);
|
|
15669
15955
|
}
|
|
15670
|
-
|
|
15671
|
-
|
|
15672
|
-
function
|
|
15956
|
+
a2.open = "";
|
|
15957
|
+
a2.close = "";
|
|
15958
|
+
function C2(n2 = false) {
|
|
15673
15959
|
let e = typeof process != "undefined" ? process : void 0, i = (e == null ? void 0 : e.env) || {}, g = (e == null ? void 0 : e.argv) || [];
|
|
15674
15960
|
return !("NO_COLOR" in i || g.includes("--no-color")) && ("FORCE_COLOR" in i || g.includes("--color") || (e == null ? void 0 : e.platform) === "win32" || n2 && i.TERM !== "dumb" || "CI" in i) || typeof window != "undefined" && !!window.chrome;
|
|
15675
15961
|
}
|
|
15676
|
-
function
|
|
15677
|
-
let e =
|
|
15678
|
-
let l2 = "",
|
|
15962
|
+
function p2(n2 = false) {
|
|
15963
|
+
let e = C2(n2), i = (r2, t, c, o) => {
|
|
15964
|
+
let l2 = "", s2 = 0;
|
|
15679
15965
|
do
|
|
15680
|
-
l2 +=
|
|
15966
|
+
l2 += r2.substring(s2, o) + c, s2 = o + t.length, o = r2.indexOf(t, s2);
|
|
15681
15967
|
while (~o);
|
|
15682
|
-
return l2 +
|
|
15683
|
-
}, g = (
|
|
15968
|
+
return l2 + r2.substring(s2);
|
|
15969
|
+
}, g = (r2, t, c = r2) => {
|
|
15684
15970
|
let o = (l2) => {
|
|
15685
|
-
let
|
|
15686
|
-
return ~b2 ?
|
|
15971
|
+
let s2 = String(l2), b2 = s2.indexOf(t, r2.length);
|
|
15972
|
+
return ~b2 ? r2 + i(s2, t, c, b2) + t : r2 + s2 + t;
|
|
15687
15973
|
};
|
|
15688
|
-
return o.open =
|
|
15689
|
-
},
|
|
15974
|
+
return o.open = r2, o.close = t, o;
|
|
15975
|
+
}, u3 = {
|
|
15690
15976
|
isColorSupported: e
|
|
15691
|
-
}, d = (
|
|
15692
|
-
for (let [
|
|
15693
|
-
|
|
15977
|
+
}, d = (r2) => `\x1B[${r2}m`;
|
|
15978
|
+
for (let [r2, t] of h3)
|
|
15979
|
+
u3[r2] = e ? g(
|
|
15694
15980
|
d(t[0]),
|
|
15695
15981
|
d(t[1]),
|
|
15696
15982
|
t[2]
|
|
15697
|
-
) :
|
|
15698
|
-
return
|
|
15983
|
+
) : a2;
|
|
15984
|
+
return u3;
|
|
15699
15985
|
}
|
|
15700
|
-
|
|
15986
|
+
p2();
|
|
15701
15987
|
var lineSplitRE = /\r?\n/;
|
|
15702
15988
|
function positionToOffset(source, lineNumber, columnNumber) {
|
|
15703
15989
|
const lines = source.split(lineSplitRE);
|
|
@@ -15734,26 +16020,26 @@ async function saveInlineSnapshots(environment, snapshots) {
|
|
|
15734
16020
|
await Promise.all(Array.from(files).map(async (file) => {
|
|
15735
16021
|
const snaps = snapshots.filter((i) => i.file === file);
|
|
15736
16022
|
const code = await environment.readSnapshotFile(file);
|
|
15737
|
-
const
|
|
16023
|
+
const s2 = new MagicString2(code);
|
|
15738
16024
|
for (const snap of snaps) {
|
|
15739
16025
|
const index2 = positionToOffset(code, snap.line, snap.column);
|
|
15740
|
-
replaceInlineSnap(code,
|
|
16026
|
+
replaceInlineSnap(code, s2, index2, snap.snapshot);
|
|
15741
16027
|
}
|
|
15742
|
-
const transformed =
|
|
16028
|
+
const transformed = s2.toString();
|
|
15743
16029
|
if (transformed !== code) {
|
|
15744
16030
|
await environment.saveSnapshotFile(file, transformed);
|
|
15745
16031
|
}
|
|
15746
16032
|
}));
|
|
15747
16033
|
}
|
|
15748
16034
|
var startObjectRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*\{/;
|
|
15749
|
-
function replaceObjectSnap(code,
|
|
16035
|
+
function replaceObjectSnap(code, s2, index2, newSnap) {
|
|
15750
16036
|
let _code = code.slice(index2);
|
|
15751
16037
|
const startMatch = startObjectRegex.exec(_code);
|
|
15752
16038
|
if (!startMatch) {
|
|
15753
16039
|
return false;
|
|
15754
16040
|
}
|
|
15755
16041
|
_code = _code.slice(startMatch.index);
|
|
15756
|
-
let callEnd =
|
|
16042
|
+
let callEnd = getCallLastIndex4(_code);
|
|
15757
16043
|
if (callEnd === null) {
|
|
15758
16044
|
return false;
|
|
15759
16045
|
}
|
|
@@ -15762,9 +16048,9 @@ function replaceObjectSnap(code, s4, index2, newSnap) {
|
|
|
15762
16048
|
const shapeEnd = getObjectShapeEndIndex(code, shapeStart);
|
|
15763
16049
|
const snap = `, ${prepareSnapString(newSnap, code, index2)}`;
|
|
15764
16050
|
if (shapeEnd === callEnd) {
|
|
15765
|
-
|
|
16051
|
+
s2.appendLeft(callEnd, snap);
|
|
15766
16052
|
} else {
|
|
15767
|
-
|
|
16053
|
+
s2.overwrite(shapeEnd, callEnd, snap);
|
|
15768
16054
|
}
|
|
15769
16055
|
return true;
|
|
15770
16056
|
}
|
|
@@ -15772,10 +16058,10 @@ function getObjectShapeEndIndex(code, index2) {
|
|
|
15772
16058
|
let startBraces = 1;
|
|
15773
16059
|
let endBraces = 0;
|
|
15774
16060
|
while (startBraces !== endBraces && index2 < code.length) {
|
|
15775
|
-
const
|
|
15776
|
-
if (
|
|
16061
|
+
const s2 = code[index2++];
|
|
16062
|
+
if (s2 === "{") {
|
|
15777
16063
|
startBraces++;
|
|
15778
|
-
} else if (
|
|
16064
|
+
} else if (s2 === "}") {
|
|
15779
16065
|
endBraces++;
|
|
15780
16066
|
}
|
|
15781
16067
|
}
|
|
@@ -15819,18 +16105,18 @@ function getCodeStartingAtIndex(code, index2) {
|
|
|
15819
16105
|
};
|
|
15820
16106
|
}
|
|
15821
16107
|
var startRegex = /(?:toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot)\s*\(\s*(?:\/\*[\s\S]*\*\/\s*|\/\/.*(?:[\n\r\u2028\u2029]\s*|[\t\v\f \xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF]))*[\w$]*(['"`)])/;
|
|
15822
|
-
function replaceInlineSnap(code,
|
|
16108
|
+
function replaceInlineSnap(code, s2, currentIndex, newSnap) {
|
|
15823
16109
|
const { code: codeStartingAtIndex, index: index2 } = getCodeStartingAtIndex(code, currentIndex);
|
|
15824
16110
|
const startMatch = startRegex.exec(codeStartingAtIndex);
|
|
15825
16111
|
const firstKeywordMatch = /toMatchInlineSnapshot|toThrowErrorMatchingInlineSnapshot/.exec(codeStartingAtIndex);
|
|
15826
16112
|
if (!startMatch || startMatch.index !== (firstKeywordMatch === null || firstKeywordMatch === void 0 ? void 0 : firstKeywordMatch.index)) {
|
|
15827
|
-
return replaceObjectSnap(code,
|
|
16113
|
+
return replaceObjectSnap(code, s2, index2, newSnap);
|
|
15828
16114
|
}
|
|
15829
16115
|
const quote = startMatch[1];
|
|
15830
16116
|
const startIndex = index2 + startMatch.index + startMatch[0].length;
|
|
15831
16117
|
const snapString = prepareSnapString(newSnap, code, index2);
|
|
15832
16118
|
if (quote === ")") {
|
|
15833
|
-
|
|
16119
|
+
s2.appendRight(startIndex - 1, snapString);
|
|
15834
16120
|
return true;
|
|
15835
16121
|
}
|
|
15836
16122
|
const quoteEndRE = new RegExp(`(?:^|[^\\\\])${quote}`);
|
|
@@ -15839,7 +16125,7 @@ function replaceInlineSnap(code, s4, currentIndex, newSnap) {
|
|
|
15839
16125
|
return false;
|
|
15840
16126
|
}
|
|
15841
16127
|
const endIndex = startIndex + endMatch.index + endMatch[0].length;
|
|
15842
|
-
|
|
16128
|
+
s2.overwrite(startIndex - 1, endIndex, snapString);
|
|
15843
16129
|
return true;
|
|
15844
16130
|
}
|
|
15845
16131
|
var INDENTATION_REGEX = /^([^\S\n]*)\S/m;
|
|
@@ -15880,7 +16166,7 @@ var hasRequiredNaturalCompare;
|
|
|
15880
16166
|
function requireNaturalCompare() {
|
|
15881
16167
|
if (hasRequiredNaturalCompare) return naturalCompare$1.exports;
|
|
15882
16168
|
hasRequiredNaturalCompare = 1;
|
|
15883
|
-
var naturalCompare2 = function(
|
|
16169
|
+
var naturalCompare2 = function(a3, b2) {
|
|
15884
16170
|
var i, codeA, codeB = 1, posA = 0, posB = 0, alphabet = String.alphabet;
|
|
15885
16171
|
function getCode(str, pos, code) {
|
|
15886
16172
|
if (code) {
|
|
@@ -15890,11 +16176,11 @@ function requireNaturalCompare() {
|
|
|
15890
16176
|
code = alphabet && alphabet.indexOf(str.charAt(pos));
|
|
15891
16177
|
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;
|
|
15892
16178
|
}
|
|
15893
|
-
if ((
|
|
15894
|
-
codeA = getCode(
|
|
16179
|
+
if ((a3 += "") != (b2 += "")) for (; codeB; ) {
|
|
16180
|
+
codeA = getCode(a3, posA++);
|
|
15895
16181
|
codeB = getCode(b2, posB++);
|
|
15896
16182
|
if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
|
|
15897
|
-
codeA = getCode(
|
|
16183
|
+
codeA = getCode(a3, posA, posA);
|
|
15898
16184
|
codeB = getCode(b2, posB, posA = i);
|
|
15899
16185
|
posB = i;
|
|
15900
16186
|
}
|
|
@@ -16020,7 +16306,7 @@ function deepMergeArray(target = [], source = []) {
|
|
|
16020
16306
|
const targetElement = mergedOutput[index2];
|
|
16021
16307
|
if (Array.isArray(target[index2])) {
|
|
16022
16308
|
mergedOutput[index2] = deepMergeArray(target[index2], sourceElement);
|
|
16023
|
-
} else if (
|
|
16309
|
+
} else if (isObject5(targetElement)) {
|
|
16024
16310
|
mergedOutput[index2] = deepMergeSnapshot(target[index2], sourceElement);
|
|
16025
16311
|
} else {
|
|
16026
16312
|
mergedOutput[index2] = sourceElement;
|
|
@@ -16029,10 +16315,10 @@ function deepMergeArray(target = [], source = []) {
|
|
|
16029
16315
|
return mergedOutput;
|
|
16030
16316
|
}
|
|
16031
16317
|
function deepMergeSnapshot(target, source) {
|
|
16032
|
-
if (
|
|
16318
|
+
if (isObject5(target) && isObject5(source)) {
|
|
16033
16319
|
const mergedOutput = { ...target };
|
|
16034
16320
|
Object.keys(source).forEach((key) => {
|
|
16035
|
-
if (
|
|
16321
|
+
if (isObject5(source[key]) && !source[key].$$typeof) {
|
|
16036
16322
|
if (!(key in target)) {
|
|
16037
16323
|
Object.assign(mergedOutput, { [key]: source[key] });
|
|
16038
16324
|
} else {
|
|
@@ -16177,8 +16463,8 @@ var SnapshotState = class _SnapshotState {
|
|
|
16177
16463
|
});
|
|
16178
16464
|
}
|
|
16179
16465
|
clearTest(testId) {
|
|
16180
|
-
this._inlineSnapshots = this._inlineSnapshots.filter((
|
|
16181
|
-
this._inlineSnapshotStacks = this._inlineSnapshotStacks.filter((
|
|
16466
|
+
this._inlineSnapshots = this._inlineSnapshots.filter((s2) => s2.testId !== testId);
|
|
16467
|
+
this._inlineSnapshotStacks = this._inlineSnapshotStacks.filter((s2) => s2.testId !== testId);
|
|
16182
16468
|
for (const key of this._testIdToKeys.get(testId)) {
|
|
16183
16469
|
const name = keyToTestName(key);
|
|
16184
16470
|
const count = this._counters.get(name);
|
|
@@ -16301,10 +16587,10 @@ ${JSON.stringify(stacks)}`);
|
|
|
16301
16587
|
}
|
|
16302
16588
|
stack = ((_this$environment$pro = (_this$environment = this.environment).processStackTrace) === null || _this$environment$pro === void 0 ? void 0 : _this$environment$pro.call(_this$environment, _stack)) || _stack;
|
|
16303
16589
|
stack.column--;
|
|
16304
|
-
const snapshotsWithSameStack = this._inlineSnapshotStacks.filter((
|
|
16590
|
+
const snapshotsWithSameStack = this._inlineSnapshotStacks.filter((s2) => isSameStackPosition(s2, stack));
|
|
16305
16591
|
if (snapshotsWithSameStack.length > 0) {
|
|
16306
|
-
this._inlineSnapshots = this._inlineSnapshots.filter((
|
|
16307
|
-
const differentSnapshot = snapshotsWithSameStack.find((
|
|
16592
|
+
this._inlineSnapshots = this._inlineSnapshots.filter((s2) => !isSameStackPosition(s2, stack));
|
|
16593
|
+
const differentSnapshot = snapshotsWithSameStack.find((s2) => s2.snapshot !== receivedSerialized);
|
|
16308
16594
|
if (differentSnapshot) {
|
|
16309
16595
|
throw Object.assign(new Error("toMatchInlineSnapshot with different snapshots cannot be called at the same location"), {
|
|
16310
16596
|
actual: receivedSerialized,
|
|
@@ -16528,7 +16814,7 @@ function normalizeWindowsPath3(input = "") {
|
|
|
16528
16814
|
if (!input) {
|
|
16529
16815
|
return input;
|
|
16530
16816
|
}
|
|
16531
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE3, (
|
|
16817
|
+
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE3, (r2) => r2.toUpperCase());
|
|
16532
16818
|
}
|
|
16533
16819
|
var _IS_ABSOLUTE_RE3 = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
16534
16820
|
function cwd3() {
|
|
@@ -16615,8 +16901,8 @@ function normalizeString3(path, allowAboveRoot) {
|
|
|
16615
16901
|
}
|
|
16616
16902
|
return res;
|
|
16617
16903
|
}
|
|
16618
|
-
var isAbsolute3 = function(
|
|
16619
|
-
return _IS_ABSOLUTE_RE3.test(
|
|
16904
|
+
var isAbsolute3 = function(p3) {
|
|
16905
|
+
return _IS_ABSOLUTE_RE3.test(p3);
|
|
16620
16906
|
};
|
|
16621
16907
|
var CHROME_IE_STACK_REGEXP3 = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
16622
16908
|
var SAFARI_NATIVE_CODE_REGEXP3 = /^(?:eval@)?(?:\[native code\])?$/;
|
|
@@ -16720,7 +17006,7 @@ function parseSingleV8Stack3(raw) {
|
|
|
16720
17006
|
var RealDate = Date;
|
|
16721
17007
|
var now2 = null;
|
|
16722
17008
|
var MockDate = class _MockDate extends RealDate {
|
|
16723
|
-
constructor(y2,
|
|
17009
|
+
constructor(y2, m2, d, h4, M2, s2, ms) {
|
|
16724
17010
|
super();
|
|
16725
17011
|
let date;
|
|
16726
17012
|
switch (arguments.length) {
|
|
@@ -16733,11 +17019,11 @@ var MockDate = class _MockDate extends RealDate {
|
|
|
16733
17019
|
break;
|
|
16734
17020
|
default:
|
|
16735
17021
|
d = typeof d === "undefined" ? 1 : d;
|
|
16736
|
-
|
|
17022
|
+
h4 = h4 || 0;
|
|
16737
17023
|
M2 = M2 || 0;
|
|
16738
|
-
|
|
17024
|
+
s2 = s2 || 0;
|
|
16739
17025
|
ms = ms || 0;
|
|
16740
|
-
date = new RealDate(y2,
|
|
17026
|
+
date = new RealDate(y2, m2, d, h4, M2, s2, ms);
|
|
16741
17027
|
break;
|
|
16742
17028
|
}
|
|
16743
17029
|
Object.setPrototypeOf(date, _MockDate.prototype);
|
|
@@ -16797,7 +17083,7 @@ function createExpectPoll(expect2) {
|
|
|
16797
17083
|
let intervalId;
|
|
16798
17084
|
let timeoutId;
|
|
16799
17085
|
let lastError;
|
|
16800
|
-
const { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } =
|
|
17086
|
+
const { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = getSafeTimers2();
|
|
16801
17087
|
const check = async () => {
|
|
16802
17088
|
try {
|
|
16803
17089
|
utils_exports.flag(assertion, "_name", key);
|
|
@@ -16965,7 +17251,7 @@ function recordAsyncExpect2(_test2, promise, assertion, error) {
|
|
|
16965
17251
|
test5.onFinished ??= [];
|
|
16966
17252
|
test5.onFinished.push(() => {
|
|
16967
17253
|
if (!resolved) {
|
|
16968
|
-
const processor = globalThis.__vitest_worker__?.onFilterStackTrace || ((
|
|
17254
|
+
const processor = globalThis.__vitest_worker__?.onFilterStackTrace || ((s2) => s2 || "");
|
|
16969
17255
|
const stack = processor(error.stack);
|
|
16970
17256
|
console.warn([
|
|
16971
17257
|
`Promise returned by \`${assertion}\` was not awaited. `,
|
|
@@ -17390,8 +17676,8 @@ function requireOrderByFirstCall() {
|
|
|
17390
17676
|
hasRequiredOrderByFirstCall = 1;
|
|
17391
17677
|
var sort2 = requireArray().sort;
|
|
17392
17678
|
var slice = requireArray().slice;
|
|
17393
|
-
function comparator(
|
|
17394
|
-
var aCall =
|
|
17679
|
+
function comparator(a3, b2) {
|
|
17680
|
+
var aCall = a3.getCall(0);
|
|
17395
17681
|
var bCall = b2.getCall(0);
|
|
17396
17682
|
var aId = aCall && aCall.callId || -1;
|
|
17397
17683
|
var bId = bCall && bCall.callId || -1;
|
|
@@ -17978,29 +18264,29 @@ ${job.error.stack.split("\n").slice(matchedLineIndex + 1).join("\n")}`;
|
|
|
17978
18264
|
}
|
|
17979
18265
|
return timer.id;
|
|
17980
18266
|
}
|
|
17981
|
-
function compareTimers(
|
|
17982
|
-
if (
|
|
18267
|
+
function compareTimers(a3, b2) {
|
|
18268
|
+
if (a3.callAt < b2.callAt) {
|
|
17983
18269
|
return -1;
|
|
17984
18270
|
}
|
|
17985
|
-
if (
|
|
18271
|
+
if (a3.callAt > b2.callAt) {
|
|
17986
18272
|
return 1;
|
|
17987
18273
|
}
|
|
17988
|
-
if (
|
|
18274
|
+
if (a3.immediate && !b2.immediate) {
|
|
17989
18275
|
return -1;
|
|
17990
18276
|
}
|
|
17991
|
-
if (!
|
|
18277
|
+
if (!a3.immediate && b2.immediate) {
|
|
17992
18278
|
return 1;
|
|
17993
18279
|
}
|
|
17994
|
-
if (
|
|
18280
|
+
if (a3.createdAt < b2.createdAt) {
|
|
17995
18281
|
return -1;
|
|
17996
18282
|
}
|
|
17997
|
-
if (
|
|
18283
|
+
if (a3.createdAt > b2.createdAt) {
|
|
17998
18284
|
return 1;
|
|
17999
18285
|
}
|
|
18000
|
-
if (
|
|
18286
|
+
if (a3.id < b2.id) {
|
|
18001
18287
|
return -1;
|
|
18002
18288
|
}
|
|
18003
|
-
if (
|
|
18289
|
+
if (a3.id > b2.id) {
|
|
18004
18290
|
return 1;
|
|
18005
18291
|
}
|
|
18006
18292
|
}
|
|
@@ -19141,7 +19427,7 @@ function copyStackTrace(target, source) {
|
|
|
19141
19427
|
return target;
|
|
19142
19428
|
}
|
|
19143
19429
|
function waitFor(callback, options = {}) {
|
|
19144
|
-
const { setTimeout: setTimeout2, setInterval, clearTimeout: clearTimeout2, clearInterval } =
|
|
19430
|
+
const { setTimeout: setTimeout2, setInterval, clearTimeout: clearTimeout2, clearInterval } = getSafeTimers2();
|
|
19145
19431
|
const { interval = 50, timeout = 1e3 } = typeof options === "number" ? { timeout: options } : options;
|
|
19146
19432
|
const STACK_TRACE_ERROR = new Error("STACK_TRACE_ERROR");
|
|
19147
19433
|
return new Promise((resolve5, reject) => {
|
|
@@ -19189,7 +19475,7 @@ function waitFor(callback, options = {}) {
|
|
|
19189
19475
|
});
|
|
19190
19476
|
}
|
|
19191
19477
|
function waitUntil(callback, options = {}) {
|
|
19192
|
-
const { setTimeout: setTimeout2, setInterval, clearTimeout: clearTimeout2, clearInterval } =
|
|
19478
|
+
const { setTimeout: setTimeout2, setInterval, clearTimeout: clearTimeout2, clearInterval } = getSafeTimers2();
|
|
19193
19479
|
const { interval = 50, timeout = 1e3 } = typeof options === "number" ? { timeout: options } : options;
|
|
19194
19480
|
const STACK_TRACE_ERROR = new Error("STACK_TRACE_ERROR");
|
|
19195
19481
|
return new Promise((resolve5, reject) => {
|
|
@@ -19330,7 +19616,7 @@ function createVitest() {
|
|
|
19330
19616
|
waitFor,
|
|
19331
19617
|
waitUntil,
|
|
19332
19618
|
hoisted(factory) {
|
|
19333
|
-
|
|
19619
|
+
assertTypes3(factory, '"vi.hoisted" factory', ["function"]);
|
|
19334
19620
|
return factory();
|
|
19335
19621
|
},
|
|
19336
19622
|
mock(path, factory) {
|
|
@@ -19436,7 +19722,7 @@ function _mocker() {
|
|
|
19436
19722
|
} });
|
|
19437
19723
|
}
|
|
19438
19724
|
function getImporter(name) {
|
|
19439
|
-
const stackTrace =
|
|
19725
|
+
const stackTrace = createSimpleStackTrace3({ stackTraceLimit: 5 });
|
|
19440
19726
|
const stackArray = stackTrace.split("\n");
|
|
19441
19727
|
const importerStackIndex = stackArray.findIndex((stack2) => {
|
|
19442
19728
|
return stack2.includes(` at Object.${name}`) || stack2.includes(`${name}@`);
|