@noma.to/qwik-testing-library 1.3.1 → 1.4.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/README.md +18 -5
- package/lib/index.qwik.cjs +0 -4
- package/lib/index.qwik.mjs +0 -4
- package/lib/lib/qwik-testing-library.qwik.cjs +18 -6
- package/lib/lib/qwik-testing-library.qwik.mjs +18 -6
- package/lib-types/lib/qwik-testing-library.d.ts +1 -2
- package/package.json +9 -9
- package/lib/lib/mock.qwik.cjs +0 -14
- package/lib/lib/mock.qwik.mjs +0 -14
- package/lib/lib/qwikloader.qwik.cjs +0 -252
- package/lib/lib/qwikloader.qwik.mjs +0 -252
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs +0 -89
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs +0 -89
- package/lib/node_modules/.pnpm/@vitest_expect@3.0.5/node_modules/@vitest/expect/dist/index.qwik.cjs +0 -2191
- package/lib/node_modules/.pnpm/@vitest_expect@3.0.5/node_modules/@vitest/expect/dist/index.qwik.mjs +0 -2191
- package/lib/node_modules/.pnpm/@vitest_pretty-format@3.0.5/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +0 -1499
- package/lib/node_modules/.pnpm/@vitest_pretty-format@3.0.5/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +0 -1499
- package/lib/node_modules/.pnpm/@vitest_runner@3.0.5/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +0 -44
- package/lib/node_modules/.pnpm/@vitest_runner@3.0.5/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +0 -44
- package/lib/node_modules/.pnpm/@vitest_runner@3.0.5/node_modules/@vitest/runner/dist/index.qwik.cjs +0 -757
- package/lib/node_modules/.pnpm/@vitest_runner@3.0.5/node_modules/@vitest/runner/dist/index.qwik.mjs +0 -757
- package/lib/node_modules/.pnpm/@vitest_snapshot@3.0.5/node_modules/@vitest/snapshot/dist/index.qwik.cjs +0 -2079
- package/lib/node_modules/.pnpm/@vitest_snapshot@3.0.5/node_modules/@vitest/snapshot/dist/index.qwik.mjs +0 -2079
- package/lib/node_modules/.pnpm/@vitest_spy@3.0.5/node_modules/@vitest/spy/dist/index.qwik.cjs +0 -165
- package/lib/node_modules/.pnpm/@vitest_spy@3.0.5/node_modules/@vitest/spy/dist/index.qwik.mjs +0 -165
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs +0 -162
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs +0 -162
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/diff.qwik.cjs +0 -1755
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/diff.qwik.mjs +0 -1755
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/error.qwik.cjs +0 -137
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/error.qwik.mjs +0 -137
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/helpers.qwik.cjs +0 -150
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/helpers.qwik.mjs +0 -150
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/index.qwik.cjs +0 -474
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/index.qwik.mjs +0 -474
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/source-map.qwik.cjs +0 -216
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/source-map.qwik.mjs +0 -216
- package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.cjs +0 -3937
- package/lib/node_modules/.pnpm/chai@5.1.2/node_modules/chai/chai.qwik.mjs +0 -3937
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/arguments.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/arguments.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/array.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/array.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/bigint.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/bigint.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/class.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/class.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/date.qwik.cjs +0 -12
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/date.qwik.mjs +0 -13
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/error.qwik.cjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/error.qwik.mjs +0 -37
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/function.qwik.cjs +0 -11
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/function.qwik.mjs +0 -12
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/helpers.qwik.cjs +0 -160
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/helpers.qwik.mjs +0 -160
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/html.qwik.cjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/html.qwik.mjs +0 -36
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/index.qwik.cjs +0 -130
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/index.qwik.mjs +0 -130
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/map.qwik.cjs +0 -23
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/map.qwik.mjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/number.qwik.cjs +0 -19
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/number.qwik.mjs +0 -20
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/object.qwik.cjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/object.qwik.mjs +0 -25
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/promise.qwik.cjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/promise.qwik.mjs +0 -18
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/regexp.qwik.cjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/regexp.qwik.mjs +0 -10
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/set.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/set.qwik.mjs +0 -17
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/string.qwik.cjs +0 -23
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/string.qwik.mjs +0 -24
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/symbol.qwik.cjs +0 -8
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/symbol.qwik.mjs +0 -9
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/typedarray.qwik.cjs +0 -34
- package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/typedarray.qwik.mjs +0 -35
- package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.cjs +0 -979
- package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.mjs +0 -979
- package/lib/node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.qwik.cjs +0 -101
- package/lib/node_modules/.pnpm/pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.qwik.mjs +0 -101
- package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +0 -4
- package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +0 -5
- package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +0 -80
- package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +0 -80
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +0 -104
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +0 -104
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +0 -8
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +0 -8
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +0 -56
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +0 -56
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +0 -66
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +0 -66
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.CjhMlMwf.qwik.cjs +0 -2977
- package/lib/node_modules/.pnpm/vitest@3.0.5_@types_node@22.13.1_@vitest_ui@3.0.5_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.CjhMlMwf.qwik.mjs +0 -2977
- package/lib-types/lib/mock.d.ts +0 -34
- package/lib-types/lib/qwikloader.d.ts +0 -1
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
2
|
-
const intToChar = new Uint8Array(64);
|
|
3
|
-
const charToInt = new Uint8Array(128);
|
|
4
|
-
for (let i = 0; i < chars.length; i++) {
|
|
5
|
-
const c = chars.charCodeAt(i);
|
|
6
|
-
intToChar[i] = c;
|
|
7
|
-
charToInt[c] = i;
|
|
8
|
-
}
|
|
9
|
-
var UrlType;
|
|
10
|
-
(function(UrlType2) {
|
|
11
|
-
UrlType2[UrlType2["Empty"] = 1] = "Empty";
|
|
12
|
-
UrlType2[UrlType2["Hash"] = 2] = "Hash";
|
|
13
|
-
UrlType2[UrlType2["Query"] = 3] = "Query";
|
|
14
|
-
UrlType2[UrlType2["RelativePath"] = 4] = "RelativePath";
|
|
15
|
-
UrlType2[UrlType2["AbsolutePath"] = 5] = "AbsolutePath";
|
|
16
|
-
UrlType2[UrlType2["SchemeRelative"] = 6] = "SchemeRelative";
|
|
17
|
-
UrlType2[UrlType2["Absolute"] = 7] = "Absolute";
|
|
18
|
-
})(UrlType || (UrlType = {}));
|
|
19
|
-
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
20
|
-
function normalizeWindowsPath(input = "") {
|
|
21
|
-
if (!input) {
|
|
22
|
-
return input;
|
|
23
|
-
}
|
|
24
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
25
|
-
}
|
|
26
|
-
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
27
|
-
function cwd() {
|
|
28
|
-
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
29
|
-
return process.cwd().replace(/\\/g, "/");
|
|
30
|
-
}
|
|
31
|
-
return "/";
|
|
32
|
-
}
|
|
33
|
-
const resolve = function(...arguments_) {
|
|
34
|
-
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
35
|
-
let resolvedPath = "";
|
|
36
|
-
let resolvedAbsolute = false;
|
|
37
|
-
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
38
|
-
const path = index >= 0 ? arguments_[index] : cwd();
|
|
39
|
-
if (!path || path.length === 0) {
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
resolvedPath = `${path}/${resolvedPath}`;
|
|
43
|
-
resolvedAbsolute = isAbsolute(path);
|
|
44
|
-
}
|
|
45
|
-
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
46
|
-
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
47
|
-
return `/${resolvedPath}`;
|
|
48
|
-
}
|
|
49
|
-
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
50
|
-
};
|
|
51
|
-
function normalizeString(path, allowAboveRoot) {
|
|
52
|
-
let res = "";
|
|
53
|
-
let lastSegmentLength = 0;
|
|
54
|
-
let lastSlash = -1;
|
|
55
|
-
let dots = 0;
|
|
56
|
-
let char = null;
|
|
57
|
-
for (let index = 0; index <= path.length; ++index) {
|
|
58
|
-
if (index < path.length) {
|
|
59
|
-
char = path[index];
|
|
60
|
-
} else if (char === "/") {
|
|
61
|
-
break;
|
|
62
|
-
} else {
|
|
63
|
-
char = "/";
|
|
64
|
-
}
|
|
65
|
-
if (char === "/") {
|
|
66
|
-
if (lastSlash === index - 1 || dots === 1) ;
|
|
67
|
-
else if (dots === 2) {
|
|
68
|
-
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
69
|
-
if (res.length > 2) {
|
|
70
|
-
const lastSlashIndex = res.lastIndexOf("/");
|
|
71
|
-
if (lastSlashIndex === -1) {
|
|
72
|
-
res = "";
|
|
73
|
-
lastSegmentLength = 0;
|
|
74
|
-
} else {
|
|
75
|
-
res = res.slice(0, lastSlashIndex);
|
|
76
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
77
|
-
}
|
|
78
|
-
lastSlash = index;
|
|
79
|
-
dots = 0;
|
|
80
|
-
continue;
|
|
81
|
-
} else if (res.length > 0) {
|
|
82
|
-
res = "";
|
|
83
|
-
lastSegmentLength = 0;
|
|
84
|
-
lastSlash = index;
|
|
85
|
-
dots = 0;
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (allowAboveRoot) {
|
|
90
|
-
res += res.length > 0 ? "/.." : "..";
|
|
91
|
-
lastSegmentLength = 2;
|
|
92
|
-
}
|
|
93
|
-
} else {
|
|
94
|
-
if (res.length > 0) {
|
|
95
|
-
res += `/${path.slice(lastSlash + 1, index)}`;
|
|
96
|
-
} else {
|
|
97
|
-
res = path.slice(lastSlash + 1, index);
|
|
98
|
-
}
|
|
99
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
100
|
-
}
|
|
101
|
-
lastSlash = index;
|
|
102
|
-
dots = 0;
|
|
103
|
-
} else if (char === "." && dots !== -1) {
|
|
104
|
-
++dots;
|
|
105
|
-
} else {
|
|
106
|
-
dots = -1;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
return res;
|
|
110
|
-
}
|
|
111
|
-
const isAbsolute = function(p) {
|
|
112
|
-
return _IS_ABSOLUTE_RE.test(p);
|
|
113
|
-
};
|
|
114
|
-
const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
|
|
115
|
-
const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
|
|
116
|
-
function extractLocation(urlLike) {
|
|
117
|
-
if (!urlLike.includes(":")) {
|
|
118
|
-
return [urlLike];
|
|
119
|
-
}
|
|
120
|
-
const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
|
|
121
|
-
const parts = regExp.exec(urlLike.replace(/^\(|\)$/g, ""));
|
|
122
|
-
if (!parts) {
|
|
123
|
-
return [urlLike];
|
|
124
|
-
}
|
|
125
|
-
let url = parts[1];
|
|
126
|
-
if (url.startsWith("async ")) {
|
|
127
|
-
url = url.slice(6);
|
|
128
|
-
}
|
|
129
|
-
if (url.startsWith("http:") || url.startsWith("https:")) {
|
|
130
|
-
const urlObj = new URL(url);
|
|
131
|
-
url = urlObj.pathname;
|
|
132
|
-
}
|
|
133
|
-
if (url.startsWith("/@fs/")) {
|
|
134
|
-
const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
|
|
135
|
-
url = url.slice(isWindows ? 5 : 4);
|
|
136
|
-
}
|
|
137
|
-
return [url, parts[2] || void 0, parts[3] || void 0];
|
|
138
|
-
}
|
|
139
|
-
function parseSingleFFOrSafariStack(raw) {
|
|
140
|
-
let line = raw.trim();
|
|
141
|
-
if (SAFARI_NATIVE_CODE_REGEXP.test(line)) {
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
if (line.includes(" > eval")) {
|
|
145
|
-
line = line.replace(
|
|
146
|
-
/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
|
|
147
|
-
":$1"
|
|
148
|
-
);
|
|
149
|
-
}
|
|
150
|
-
if (!line.includes("@") && !line.includes(":")) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
|
|
154
|
-
const matches = line.match(functionNameRegex);
|
|
155
|
-
const functionName = matches && matches[1] ? matches[1] : void 0;
|
|
156
|
-
const [url, lineNumber, columnNumber] = extractLocation(
|
|
157
|
-
line.replace(functionNameRegex, "")
|
|
158
|
-
);
|
|
159
|
-
if (!url || !lineNumber || !columnNumber) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
file: url,
|
|
164
|
-
method: functionName || "",
|
|
165
|
-
line: Number.parseInt(lineNumber),
|
|
166
|
-
column: Number.parseInt(columnNumber)
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
function parseSingleStack(raw) {
|
|
170
|
-
const line = raw.trim();
|
|
171
|
-
if (!CHROME_IE_STACK_REGEXP.test(line)) {
|
|
172
|
-
return parseSingleFFOrSafariStack(line);
|
|
173
|
-
}
|
|
174
|
-
return parseSingleV8Stack(line);
|
|
175
|
-
}
|
|
176
|
-
function parseSingleV8Stack(raw) {
|
|
177
|
-
let line = raw.trim();
|
|
178
|
-
if (!CHROME_IE_STACK_REGEXP.test(line)) {
|
|
179
|
-
return null;
|
|
180
|
-
}
|
|
181
|
-
if (line.includes("(eval ")) {
|
|
182
|
-
line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
|
|
183
|
-
}
|
|
184
|
-
let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
|
|
185
|
-
const location = sanitizedLine.match(/ (\(.+\)$)/);
|
|
186
|
-
sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
|
|
187
|
-
const [url, lineNumber, columnNumber] = extractLocation(
|
|
188
|
-
location ? location[1] : sanitizedLine
|
|
189
|
-
);
|
|
190
|
-
let method = location && sanitizedLine || "";
|
|
191
|
-
let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
|
|
192
|
-
if (!file || !lineNumber || !columnNumber) {
|
|
193
|
-
return null;
|
|
194
|
-
}
|
|
195
|
-
if (method.startsWith("async ")) {
|
|
196
|
-
method = method.slice(6);
|
|
197
|
-
}
|
|
198
|
-
if (file.startsWith("file://")) {
|
|
199
|
-
file = file.slice(7);
|
|
200
|
-
}
|
|
201
|
-
file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
|
|
202
|
-
if (method) {
|
|
203
|
-
method = method.replace(/__vite_ssr_import_\d+__\./g, "");
|
|
204
|
-
}
|
|
205
|
-
return {
|
|
206
|
-
method,
|
|
207
|
-
file,
|
|
208
|
-
line: Number.parseInt(lineNumber),
|
|
209
|
-
column: Number.parseInt(columnNumber)
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
export {
|
|
213
|
-
parseSingleFFOrSafariStack,
|
|
214
|
-
parseSingleStack,
|
|
215
|
-
parseSingleV8Stack
|
|
216
|
-
};
|