@noma.to/qwik-mock 0.0.0-semantically-released

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +8 -0
  2. package/lib/index.qwik.cjs +6 -0
  3. package/lib/index.qwik.mjs +6 -0
  4. package/lib/lib/qwik-mock.qwik.cjs +14 -0
  5. package/lib/lib/qwik-mock.qwik.mjs +14 -0
  6. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs +89 -0
  7. package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs +89 -0
  8. package/lib/node_modules/.pnpm/@vitest_expect@3.0.9/node_modules/@vitest/expect/dist/index.qwik.cjs +2190 -0
  9. package/lib/node_modules/.pnpm/@vitest_expect@3.0.9/node_modules/@vitest/expect/dist/index.qwik.mjs +2190 -0
  10. package/lib/node_modules/.pnpm/@vitest_pretty-format@3.0.9/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +1499 -0
  11. package/lib/node_modules/.pnpm/@vitest_pretty-format@3.0.9/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +1499 -0
  12. package/lib/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +44 -0
  13. package/lib/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +44 -0
  14. package/lib/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.qwik.cjs +767 -0
  15. package/lib/node_modules/.pnpm/@vitest_runner@3.0.9/node_modules/@vitest/runner/dist/index.qwik.mjs +767 -0
  16. package/lib/node_modules/.pnpm/@vitest_snapshot@3.0.9/node_modules/@vitest/snapshot/dist/index.qwik.cjs +2149 -0
  17. package/lib/node_modules/.pnpm/@vitest_snapshot@3.0.9/node_modules/@vitest/snapshot/dist/index.qwik.mjs +2149 -0
  18. package/lib/node_modules/.pnpm/@vitest_spy@3.0.9/node_modules/@vitest/spy/dist/index.qwik.cjs +147 -0
  19. package/lib/node_modules/.pnpm/@vitest_spy@3.0.9/node_modules/@vitest/spy/dist/index.qwik.mjs +147 -0
  20. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs +165 -0
  21. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs +165 -0
  22. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/diff.qwik.cjs +1755 -0
  23. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/diff.qwik.mjs +1755 -0
  24. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/error.qwik.cjs +137 -0
  25. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/error.qwik.mjs +137 -0
  26. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/helpers.qwik.cjs +150 -0
  27. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/helpers.qwik.mjs +150 -0
  28. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.qwik.cjs +474 -0
  29. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/index.qwik.mjs +474 -0
  30. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.qwik.cjs +218 -0
  31. package/lib/node_modules/.pnpm/@vitest_utils@3.0.9/node_modules/@vitest/utils/dist/source-map.qwik.mjs +218 -0
  32. package/lib/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.qwik.cjs +4237 -0
  33. package/lib/node_modules/.pnpm/chai@5.2.0/node_modules/chai/chai.qwik.mjs +4237 -0
  34. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/arguments.qwik.cjs +9 -0
  35. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/arguments.qwik.mjs +10 -0
  36. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/array.qwik.cjs +16 -0
  37. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/array.qwik.mjs +17 -0
  38. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/bigint.qwik.cjs +9 -0
  39. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/bigint.qwik.mjs +10 -0
  40. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/class.qwik.cjs +16 -0
  41. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/class.qwik.mjs +17 -0
  42. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/date.qwik.cjs +12 -0
  43. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/date.qwik.mjs +13 -0
  44. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/error.qwik.cjs +36 -0
  45. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/error.qwik.mjs +37 -0
  46. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/function.qwik.cjs +11 -0
  47. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/function.qwik.mjs +12 -0
  48. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/helpers.qwik.cjs +160 -0
  49. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/helpers.qwik.mjs +160 -0
  50. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/html.qwik.cjs +36 -0
  51. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/html.qwik.mjs +36 -0
  52. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/index.qwik.cjs +130 -0
  53. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/index.qwik.mjs +130 -0
  54. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/map.qwik.cjs +23 -0
  55. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/map.qwik.mjs +24 -0
  56. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/number.qwik.cjs +19 -0
  57. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/number.qwik.mjs +20 -0
  58. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/object.qwik.cjs +24 -0
  59. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/object.qwik.mjs +25 -0
  60. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/promise.qwik.cjs +17 -0
  61. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/promise.qwik.mjs +18 -0
  62. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/regexp.qwik.cjs +9 -0
  63. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/regexp.qwik.mjs +10 -0
  64. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/set.qwik.cjs +16 -0
  65. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/set.qwik.mjs +17 -0
  66. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/string.qwik.cjs +23 -0
  67. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/string.qwik.mjs +24 -0
  68. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/symbol.qwik.cjs +8 -0
  69. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/symbol.qwik.mjs +9 -0
  70. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/typedarray.qwik.cjs +34 -0
  71. package/lib/node_modules/.pnpm/loupe@3.1.3/node_modules/loupe/lib/typedarray.qwik.mjs +35 -0
  72. package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.cjs +979 -0
  73. package/lib/node_modules/.pnpm/magic-string@0.30.17/node_modules/magic-string/dist/magic-string.es.qwik.mjs +979 -0
  74. package/lib/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.qwik.cjs +101 -0
  75. package/lib/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.qwik.mjs +101 -0
  76. package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +4 -0
  77. package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +5 -0
  78. package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +80 -0
  79. package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +80 -0
  80. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +104 -0
  81. package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +104 -0
  82. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.cjs +8 -0
  83. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.qwik.mjs +8 -0
  84. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.cjs +56 -0
  85. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +56 -0
  86. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +66 -0
  87. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +66 -0
  88. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.nSCvwQ7l.qwik.cjs +2983 -0
  89. package/lib/node_modules/.pnpm/vitest@3.0.9_@types_node@22.13.8_@vitest_ui@3.0.9_jiti@2.4.2_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.nSCvwQ7l.qwik.mjs +2983 -0
  90. package/lib-types/index.d.ts +1 -0
  91. package/lib-types/lib/qwik-mock.d.ts +34 -0
  92. package/package.json +53 -0
@@ -0,0 +1,218 @@
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
+ urlObj.searchParams.delete("import");
132
+ urlObj.searchParams.delete("browserv");
133
+ url = urlObj.pathname + urlObj.hash + urlObj.search;
134
+ }
135
+ if (url.startsWith("/@fs/")) {
136
+ const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
137
+ url = url.slice(isWindows ? 5 : 4);
138
+ }
139
+ return [url, parts[2] || void 0, parts[3] || void 0];
140
+ }
141
+ function parseSingleFFOrSafariStack(raw) {
142
+ let line = raw.trim();
143
+ if (SAFARI_NATIVE_CODE_REGEXP.test(line)) {
144
+ return null;
145
+ }
146
+ if (line.includes(" > eval")) {
147
+ line = line.replace(
148
+ / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
149
+ ":$1"
150
+ );
151
+ }
152
+ if (!line.includes("@") && !line.includes(":")) {
153
+ return null;
154
+ }
155
+ const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
156
+ const matches = line.match(functionNameRegex);
157
+ const functionName = matches && matches[1] ? matches[1] : void 0;
158
+ const [url, lineNumber, columnNumber] = extractLocation(
159
+ line.replace(functionNameRegex, "")
160
+ );
161
+ if (!url || !lineNumber || !columnNumber) {
162
+ return null;
163
+ }
164
+ return {
165
+ file: url,
166
+ method: functionName || "",
167
+ line: Number.parseInt(lineNumber),
168
+ column: Number.parseInt(columnNumber)
169
+ };
170
+ }
171
+ function parseSingleStack(raw) {
172
+ const line = raw.trim();
173
+ if (!CHROME_IE_STACK_REGEXP.test(line)) {
174
+ return parseSingleFFOrSafariStack(line);
175
+ }
176
+ return parseSingleV8Stack(line);
177
+ }
178
+ function parseSingleV8Stack(raw) {
179
+ let line = raw.trim();
180
+ if (!CHROME_IE_STACK_REGEXP.test(line)) {
181
+ return null;
182
+ }
183
+ if (line.includes("(eval ")) {
184
+ line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
185
+ }
186
+ let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
187
+ const location = sanitizedLine.match(/ (\(.+\)$)/);
188
+ sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
189
+ const [url, lineNumber, columnNumber] = extractLocation(
190
+ location ? location[1] : sanitizedLine
191
+ );
192
+ let method = location && sanitizedLine || "";
193
+ let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
194
+ if (!file || !lineNumber || !columnNumber) {
195
+ return null;
196
+ }
197
+ if (method.startsWith("async ")) {
198
+ method = method.slice(6);
199
+ }
200
+ if (file.startsWith("file://")) {
201
+ file = file.slice(7);
202
+ }
203
+ file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
204
+ if (method) {
205
+ method = method.replace(/__vite_ssr_import_\d+__\./g, "");
206
+ }
207
+ return {
208
+ method,
209
+ file,
210
+ line: Number.parseInt(lineNumber),
211
+ column: Number.parseInt(columnNumber)
212
+ };
213
+ }
214
+ export {
215
+ parseSingleFFOrSafariStack,
216
+ parseSingleStack,
217
+ parseSingleV8Stack
218
+ };