@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,474 @@
1
+ import "../../../../../tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.mjs";
2
+ import "../../../../../loupe@3.1.3/node_modules/loupe/lib/index.qwik.mjs";
3
+ var jsTokens_1;
4
+ var hasRequiredJsTokens;
5
+ function requireJsTokens() {
6
+ if (hasRequiredJsTokens) return jsTokens_1;
7
+ hasRequiredJsTokens = 1;
8
+ var Identifier, JSXIdentifier, JSXPunctuator, JSXString, JSXText, KeywordsWithExpressionAfter, KeywordsWithNoLineTerminatorAfter, LineTerminatorSequence, MultiLineComment, Newline, NumericLiteral, Punctuator, RegularExpressionLiteral, SingleLineComment, StringLiteral, Template, TokensNotPrecedingObjectLiteral, TokensPrecedingExpression, WhiteSpace;
9
+ RegularExpressionLiteral = /\/(?![*\/])(?:\[(?:(?![\]\\]).|\\.)*\]|(?![\/\\]).|\\.)*(\/[$_\u200C\u200D\p{ID_Continue}]*|\\)?/yu;
10
+ Punctuator = /--|\+\+|=>|\.{3}|\??\.(?!\d)|(?:&&|\|\||\?\?|[+\-%&|^]|\*{1,2}|<{1,2}|>{1,3}|!=?|={1,2}|\/(?![\/*]))=?|[?~,:;[\](){}]/y;
11
+ Identifier = /(\x23?)(?=[$_\p{ID_Start}\\])(?:[$_\u200C\u200D\p{ID_Continue}]|\\u[\da-fA-F]{4}|\\u\{[\da-fA-F]+\})+/yu;
12
+ StringLiteral = /(['"])(?:(?!\1)[^\\\n\r]|\\(?:\r\n|[^]))*(\1)?/y;
13
+ 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;
14
+ Template = /[`}](?:[^`\\$]|\\[^]|\$(?!\{))*(`|\$\{)?/y;
15
+ WhiteSpace = /[\t\v\f\ufeff\p{Zs}]+/yu;
16
+ LineTerminatorSequence = /\r?\n|[\r\u2028\u2029]/y;
17
+ MultiLineComment = /\/\*(?:[^*]|\*(?!\/))*(\*\/)?/y;
18
+ SingleLineComment = /\/\/.*/y;
19
+ JSXPunctuator = /[<>.:={}]|\/(?![\/*])/y;
20
+ JSXIdentifier = /[$_\p{ID_Start}][$_\u200C\u200D\p{ID_Continue}-]*/yu;
21
+ JSXString = /(['"])(?:(?!\1)[^])*(\1)?/y;
22
+ JSXText = /[^<>{}]+/y;
23
+ TokensPrecedingExpression = /^(?:[\/+-]|\.{3}|\?(?:InterpolationIn(?:JSX|Template)|NoLineTerminatorHere|NonExpressionParenEnd|UnaryIncDec))?$|[{}([,;<>=*%&|^!~?:]$/;
24
+ TokensNotPrecedingObjectLiteral = /^(?:=>|[;\]){}]|else|\?(?:NoLineTerminatorHere|NonExpressionParenEnd))?$/;
25
+ KeywordsWithExpressionAfter = /^(?:await|case|default|delete|do|else|instanceof|new|return|throw|typeof|void|yield)$/;
26
+ KeywordsWithNoLineTerminatorAfter = /^(?:return|throw|yield)$/;
27
+ Newline = RegExp(LineTerminatorSequence.source);
28
+ jsTokens_1 = function* (input, { jsx = false } = {}) {
29
+ var braces, firstCodePoint, isExpression, lastIndex, lastSignificantToken, length, match, mode, nextLastIndex, nextLastSignificantToken, parenNesting, postfixIncDec, punctuator, stack;
30
+ ({ length } = input);
31
+ lastIndex = 0;
32
+ lastSignificantToken = "";
33
+ stack = [
34
+ { tag: "JS" }
35
+ ];
36
+ braces = [];
37
+ parenNesting = 0;
38
+ postfixIncDec = false;
39
+ while (lastIndex < length) {
40
+ mode = stack[stack.length - 1];
41
+ switch (mode.tag) {
42
+ case "JS":
43
+ case "JSNonExpressionParen":
44
+ case "InterpolationInTemplate":
45
+ case "InterpolationInJSX":
46
+ if (input[lastIndex] === "/" && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
47
+ RegularExpressionLiteral.lastIndex = lastIndex;
48
+ if (match = RegularExpressionLiteral.exec(input)) {
49
+ lastIndex = RegularExpressionLiteral.lastIndex;
50
+ lastSignificantToken = match[0];
51
+ postfixIncDec = true;
52
+ yield {
53
+ type: "RegularExpressionLiteral",
54
+ value: match[0],
55
+ closed: match[1] !== void 0 && match[1] !== "\\"
56
+ };
57
+ continue;
58
+ }
59
+ }
60
+ Punctuator.lastIndex = lastIndex;
61
+ if (match = Punctuator.exec(input)) {
62
+ punctuator = match[0];
63
+ nextLastIndex = Punctuator.lastIndex;
64
+ nextLastSignificantToken = punctuator;
65
+ switch (punctuator) {
66
+ case "(":
67
+ if (lastSignificantToken === "?NonExpressionParenKeyword") {
68
+ stack.push({
69
+ tag: "JSNonExpressionParen",
70
+ nesting: parenNesting
71
+ });
72
+ }
73
+ parenNesting++;
74
+ postfixIncDec = false;
75
+ break;
76
+ case ")":
77
+ parenNesting--;
78
+ postfixIncDec = true;
79
+ if (mode.tag === "JSNonExpressionParen" && parenNesting === mode.nesting) {
80
+ stack.pop();
81
+ nextLastSignificantToken = "?NonExpressionParenEnd";
82
+ postfixIncDec = false;
83
+ }
84
+ break;
85
+ case "{":
86
+ Punctuator.lastIndex = 0;
87
+ isExpression = !TokensNotPrecedingObjectLiteral.test(lastSignificantToken) && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken));
88
+ braces.push(isExpression);
89
+ postfixIncDec = false;
90
+ break;
91
+ case "}":
92
+ switch (mode.tag) {
93
+ case "InterpolationInTemplate":
94
+ if (braces.length === mode.nesting) {
95
+ Template.lastIndex = lastIndex;
96
+ match = Template.exec(input);
97
+ lastIndex = Template.lastIndex;
98
+ lastSignificantToken = match[0];
99
+ if (match[1] === "${") {
100
+ lastSignificantToken = "?InterpolationInTemplate";
101
+ postfixIncDec = false;
102
+ yield {
103
+ type: "TemplateMiddle",
104
+ value: match[0]
105
+ };
106
+ } else {
107
+ stack.pop();
108
+ postfixIncDec = true;
109
+ yield {
110
+ type: "TemplateTail",
111
+ value: match[0],
112
+ closed: match[1] === "`"
113
+ };
114
+ }
115
+ continue;
116
+ }
117
+ break;
118
+ case "InterpolationInJSX":
119
+ if (braces.length === mode.nesting) {
120
+ stack.pop();
121
+ lastIndex += 1;
122
+ lastSignificantToken = "}";
123
+ yield {
124
+ type: "JSXPunctuator",
125
+ value: "}"
126
+ };
127
+ continue;
128
+ }
129
+ }
130
+ postfixIncDec = braces.pop();
131
+ nextLastSignificantToken = postfixIncDec ? "?ExpressionBraceEnd" : "}";
132
+ break;
133
+ case "]":
134
+ postfixIncDec = true;
135
+ break;
136
+ case "++":
137
+ case "--":
138
+ nextLastSignificantToken = postfixIncDec ? "?PostfixIncDec" : "?UnaryIncDec";
139
+ break;
140
+ case "<":
141
+ if (jsx && (TokensPrecedingExpression.test(lastSignificantToken) || KeywordsWithExpressionAfter.test(lastSignificantToken))) {
142
+ stack.push({ tag: "JSXTag" });
143
+ lastIndex += 1;
144
+ lastSignificantToken = "<";
145
+ yield {
146
+ type: "JSXPunctuator",
147
+ value: punctuator
148
+ };
149
+ continue;
150
+ }
151
+ postfixIncDec = false;
152
+ break;
153
+ default:
154
+ postfixIncDec = false;
155
+ }
156
+ lastIndex = nextLastIndex;
157
+ lastSignificantToken = nextLastSignificantToken;
158
+ yield {
159
+ type: "Punctuator",
160
+ value: punctuator
161
+ };
162
+ continue;
163
+ }
164
+ Identifier.lastIndex = lastIndex;
165
+ if (match = Identifier.exec(input)) {
166
+ lastIndex = Identifier.lastIndex;
167
+ nextLastSignificantToken = match[0];
168
+ switch (match[0]) {
169
+ case "for":
170
+ case "if":
171
+ case "while":
172
+ case "with":
173
+ if (lastSignificantToken !== "." && lastSignificantToken !== "?.") {
174
+ nextLastSignificantToken = "?NonExpressionParenKeyword";
175
+ }
176
+ }
177
+ lastSignificantToken = nextLastSignificantToken;
178
+ postfixIncDec = !KeywordsWithExpressionAfter.test(match[0]);
179
+ yield {
180
+ type: match[1] === "#" ? "PrivateIdentifier" : "IdentifierName",
181
+ value: match[0]
182
+ };
183
+ continue;
184
+ }
185
+ StringLiteral.lastIndex = lastIndex;
186
+ if (match = StringLiteral.exec(input)) {
187
+ lastIndex = StringLiteral.lastIndex;
188
+ lastSignificantToken = match[0];
189
+ postfixIncDec = true;
190
+ yield {
191
+ type: "StringLiteral",
192
+ value: match[0],
193
+ closed: match[2] !== void 0
194
+ };
195
+ continue;
196
+ }
197
+ NumericLiteral.lastIndex = lastIndex;
198
+ if (match = NumericLiteral.exec(input)) {
199
+ lastIndex = NumericLiteral.lastIndex;
200
+ lastSignificantToken = match[0];
201
+ postfixIncDec = true;
202
+ yield {
203
+ type: "NumericLiteral",
204
+ value: match[0]
205
+ };
206
+ continue;
207
+ }
208
+ Template.lastIndex = lastIndex;
209
+ if (match = Template.exec(input)) {
210
+ lastIndex = Template.lastIndex;
211
+ lastSignificantToken = match[0];
212
+ if (match[1] === "${") {
213
+ lastSignificantToken = "?InterpolationInTemplate";
214
+ stack.push({
215
+ tag: "InterpolationInTemplate",
216
+ nesting: braces.length
217
+ });
218
+ postfixIncDec = false;
219
+ yield {
220
+ type: "TemplateHead",
221
+ value: match[0]
222
+ };
223
+ } else {
224
+ postfixIncDec = true;
225
+ yield {
226
+ type: "NoSubstitutionTemplate",
227
+ value: match[0],
228
+ closed: match[1] === "`"
229
+ };
230
+ }
231
+ continue;
232
+ }
233
+ break;
234
+ case "JSXTag":
235
+ case "JSXTagEnd":
236
+ JSXPunctuator.lastIndex = lastIndex;
237
+ if (match = JSXPunctuator.exec(input)) {
238
+ lastIndex = JSXPunctuator.lastIndex;
239
+ nextLastSignificantToken = match[0];
240
+ switch (match[0]) {
241
+ case "<":
242
+ stack.push({ tag: "JSXTag" });
243
+ break;
244
+ case ">":
245
+ stack.pop();
246
+ if (lastSignificantToken === "/" || mode.tag === "JSXTagEnd") {
247
+ nextLastSignificantToken = "?JSX";
248
+ postfixIncDec = true;
249
+ } else {
250
+ stack.push({ tag: "JSXChildren" });
251
+ }
252
+ break;
253
+ case "{":
254
+ stack.push({
255
+ tag: "InterpolationInJSX",
256
+ nesting: braces.length
257
+ });
258
+ nextLastSignificantToken = "?InterpolationInJSX";
259
+ postfixIncDec = false;
260
+ break;
261
+ case "/":
262
+ if (lastSignificantToken === "<") {
263
+ stack.pop();
264
+ if (stack[stack.length - 1].tag === "JSXChildren") {
265
+ stack.pop();
266
+ }
267
+ stack.push({ tag: "JSXTagEnd" });
268
+ }
269
+ }
270
+ lastSignificantToken = nextLastSignificantToken;
271
+ yield {
272
+ type: "JSXPunctuator",
273
+ value: match[0]
274
+ };
275
+ continue;
276
+ }
277
+ JSXIdentifier.lastIndex = lastIndex;
278
+ if (match = JSXIdentifier.exec(input)) {
279
+ lastIndex = JSXIdentifier.lastIndex;
280
+ lastSignificantToken = match[0];
281
+ yield {
282
+ type: "JSXIdentifier",
283
+ value: match[0]
284
+ };
285
+ continue;
286
+ }
287
+ JSXString.lastIndex = lastIndex;
288
+ if (match = JSXString.exec(input)) {
289
+ lastIndex = JSXString.lastIndex;
290
+ lastSignificantToken = match[0];
291
+ yield {
292
+ type: "JSXString",
293
+ value: match[0],
294
+ closed: match[2] !== void 0
295
+ };
296
+ continue;
297
+ }
298
+ break;
299
+ case "JSXChildren":
300
+ JSXText.lastIndex = lastIndex;
301
+ if (match = JSXText.exec(input)) {
302
+ lastIndex = JSXText.lastIndex;
303
+ lastSignificantToken = match[0];
304
+ yield {
305
+ type: "JSXText",
306
+ value: match[0]
307
+ };
308
+ continue;
309
+ }
310
+ switch (input[lastIndex]) {
311
+ case "<":
312
+ stack.push({ tag: "JSXTag" });
313
+ lastIndex++;
314
+ lastSignificantToken = "<";
315
+ yield {
316
+ type: "JSXPunctuator",
317
+ value: "<"
318
+ };
319
+ continue;
320
+ case "{":
321
+ stack.push({
322
+ tag: "InterpolationInJSX",
323
+ nesting: braces.length
324
+ });
325
+ lastIndex++;
326
+ lastSignificantToken = "?InterpolationInJSX";
327
+ postfixIncDec = false;
328
+ yield {
329
+ type: "JSXPunctuator",
330
+ value: "{"
331
+ };
332
+ continue;
333
+ }
334
+ }
335
+ WhiteSpace.lastIndex = lastIndex;
336
+ if (match = WhiteSpace.exec(input)) {
337
+ lastIndex = WhiteSpace.lastIndex;
338
+ yield {
339
+ type: "WhiteSpace",
340
+ value: match[0]
341
+ };
342
+ continue;
343
+ }
344
+ LineTerminatorSequence.lastIndex = lastIndex;
345
+ if (match = LineTerminatorSequence.exec(input)) {
346
+ lastIndex = LineTerminatorSequence.lastIndex;
347
+ postfixIncDec = false;
348
+ if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
349
+ lastSignificantToken = "?NoLineTerminatorHere";
350
+ }
351
+ yield {
352
+ type: "LineTerminatorSequence",
353
+ value: match[0]
354
+ };
355
+ continue;
356
+ }
357
+ MultiLineComment.lastIndex = lastIndex;
358
+ if (match = MultiLineComment.exec(input)) {
359
+ lastIndex = MultiLineComment.lastIndex;
360
+ if (Newline.test(match[0])) {
361
+ postfixIncDec = false;
362
+ if (KeywordsWithNoLineTerminatorAfter.test(lastSignificantToken)) {
363
+ lastSignificantToken = "?NoLineTerminatorHere";
364
+ }
365
+ }
366
+ yield {
367
+ type: "MultiLineComment",
368
+ value: match[0],
369
+ closed: match[1] !== void 0
370
+ };
371
+ continue;
372
+ }
373
+ SingleLineComment.lastIndex = lastIndex;
374
+ if (match = SingleLineComment.exec(input)) {
375
+ lastIndex = SingleLineComment.lastIndex;
376
+ postfixIncDec = false;
377
+ yield {
378
+ type: "SingleLineComment",
379
+ value: match[0]
380
+ };
381
+ continue;
382
+ }
383
+ firstCodePoint = String.fromCodePoint(input.codePointAt(lastIndex));
384
+ lastIndex += firstCodePoint.length;
385
+ lastSignificantToken = firstCodePoint;
386
+ postfixIncDec = false;
387
+ yield {
388
+ type: mode.tag.startsWith("JSX") ? "JSXInvalid" : "Invalid",
389
+ value: firstCodePoint
390
+ };
391
+ }
392
+ return void 0;
393
+ };
394
+ return jsTokens_1;
395
+ }
396
+ requireJsTokens();
397
+ var reservedWords = {
398
+ keyword: [
399
+ "break",
400
+ "case",
401
+ "catch",
402
+ "continue",
403
+ "debugger",
404
+ "default",
405
+ "do",
406
+ "else",
407
+ "finally",
408
+ "for",
409
+ "function",
410
+ "if",
411
+ "return",
412
+ "switch",
413
+ "throw",
414
+ "try",
415
+ "var",
416
+ "const",
417
+ "while",
418
+ "with",
419
+ "new",
420
+ "this",
421
+ "super",
422
+ "class",
423
+ "extends",
424
+ "export",
425
+ "import",
426
+ "null",
427
+ "true",
428
+ "false",
429
+ "in",
430
+ "instanceof",
431
+ "typeof",
432
+ "void",
433
+ "delete"
434
+ ],
435
+ strict: [
436
+ "implements",
437
+ "interface",
438
+ "let",
439
+ "package",
440
+ "private",
441
+ "protected",
442
+ "public",
443
+ "static",
444
+ "yield"
445
+ ]
446
+ };
447
+ new Set(reservedWords.keyword);
448
+ new Set(reservedWords.strict);
449
+ const SAFE_TIMERS_SYMBOL = Symbol("vitest:SAFE_TIMERS");
450
+ function getSafeTimers() {
451
+ const {
452
+ setTimeout: safeSetTimeout,
453
+ setInterval: safeSetInterval,
454
+ clearInterval: safeClearInterval,
455
+ clearTimeout: safeClearTimeout,
456
+ setImmediate: safeSetImmediate,
457
+ clearImmediate: safeClearImmediate,
458
+ queueMicrotask: safeQueueMicrotask
459
+ } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis;
460
+ const { nextTick: safeNextTick } = globalThis[SAFE_TIMERS_SYMBOL] || globalThis.process || { nextTick: (cb) => cb() };
461
+ return {
462
+ nextTick: safeNextTick,
463
+ setTimeout: safeSetTimeout,
464
+ setInterval: safeSetInterval,
465
+ clearInterval: safeClearInterval,
466
+ clearTimeout: safeClearTimeout,
467
+ setImmediate: safeSetImmediate,
468
+ clearImmediate: safeClearImmediate,
469
+ queueMicrotask: safeQueueMicrotask
470
+ };
471
+ }
472
+ export {
473
+ getSafeTimers
474
+ };
@@ -0,0 +1,218 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
4
+ const intToChar = new Uint8Array(64);
5
+ const charToInt = new Uint8Array(128);
6
+ for (let i = 0; i < chars.length; i++) {
7
+ const c = chars.charCodeAt(i);
8
+ intToChar[i] = c;
9
+ charToInt[c] = i;
10
+ }
11
+ var UrlType;
12
+ (function(UrlType2) {
13
+ UrlType2[UrlType2["Empty"] = 1] = "Empty";
14
+ UrlType2[UrlType2["Hash"] = 2] = "Hash";
15
+ UrlType2[UrlType2["Query"] = 3] = "Query";
16
+ UrlType2[UrlType2["RelativePath"] = 4] = "RelativePath";
17
+ UrlType2[UrlType2["AbsolutePath"] = 5] = "AbsolutePath";
18
+ UrlType2[UrlType2["SchemeRelative"] = 6] = "SchemeRelative";
19
+ UrlType2[UrlType2["Absolute"] = 7] = "Absolute";
20
+ })(UrlType || (UrlType = {}));
21
+ const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
22
+ function normalizeWindowsPath(input = "") {
23
+ if (!input) {
24
+ return input;
25
+ }
26
+ return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
27
+ }
28
+ const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
29
+ function cwd() {
30
+ if (typeof process !== "undefined" && typeof process.cwd === "function") {
31
+ return process.cwd().replace(/\\/g, "/");
32
+ }
33
+ return "/";
34
+ }
35
+ const resolve = function(...arguments_) {
36
+ arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
37
+ let resolvedPath = "";
38
+ let resolvedAbsolute = false;
39
+ for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
40
+ const path = index >= 0 ? arguments_[index] : cwd();
41
+ if (!path || path.length === 0) {
42
+ continue;
43
+ }
44
+ resolvedPath = `${path}/${resolvedPath}`;
45
+ resolvedAbsolute = isAbsolute(path);
46
+ }
47
+ resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
48
+ if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
49
+ return `/${resolvedPath}`;
50
+ }
51
+ return resolvedPath.length > 0 ? resolvedPath : ".";
52
+ };
53
+ function normalizeString(path, allowAboveRoot) {
54
+ let res = "";
55
+ let lastSegmentLength = 0;
56
+ let lastSlash = -1;
57
+ let dots = 0;
58
+ let char = null;
59
+ for (let index = 0; index <= path.length; ++index) {
60
+ if (index < path.length) {
61
+ char = path[index];
62
+ } else if (char === "/") {
63
+ break;
64
+ } else {
65
+ char = "/";
66
+ }
67
+ if (char === "/") {
68
+ if (lastSlash === index - 1 || dots === 1) ;
69
+ else if (dots === 2) {
70
+ if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
71
+ if (res.length > 2) {
72
+ const lastSlashIndex = res.lastIndexOf("/");
73
+ if (lastSlashIndex === -1) {
74
+ res = "";
75
+ lastSegmentLength = 0;
76
+ } else {
77
+ res = res.slice(0, lastSlashIndex);
78
+ lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
79
+ }
80
+ lastSlash = index;
81
+ dots = 0;
82
+ continue;
83
+ } else if (res.length > 0) {
84
+ res = "";
85
+ lastSegmentLength = 0;
86
+ lastSlash = index;
87
+ dots = 0;
88
+ continue;
89
+ }
90
+ }
91
+ if (allowAboveRoot) {
92
+ res += res.length > 0 ? "/.." : "..";
93
+ lastSegmentLength = 2;
94
+ }
95
+ } else {
96
+ if (res.length > 0) {
97
+ res += `/${path.slice(lastSlash + 1, index)}`;
98
+ } else {
99
+ res = path.slice(lastSlash + 1, index);
100
+ }
101
+ lastSegmentLength = index - lastSlash - 1;
102
+ }
103
+ lastSlash = index;
104
+ dots = 0;
105
+ } else if (char === "." && dots !== -1) {
106
+ ++dots;
107
+ } else {
108
+ dots = -1;
109
+ }
110
+ }
111
+ return res;
112
+ }
113
+ const isAbsolute = function(p) {
114
+ return _IS_ABSOLUTE_RE.test(p);
115
+ };
116
+ const CHROME_IE_STACK_REGEXP = /^\s*at .*(?:\S:\d+|\(native\))/m;
117
+ const SAFARI_NATIVE_CODE_REGEXP = /^(?:eval@)?(?:\[native code\])?$/;
118
+ function extractLocation(urlLike) {
119
+ if (!urlLike.includes(":")) {
120
+ return [urlLike];
121
+ }
122
+ const regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
123
+ const parts = regExp.exec(urlLike.replace(/^\(|\)$/g, ""));
124
+ if (!parts) {
125
+ return [urlLike];
126
+ }
127
+ let url = parts[1];
128
+ if (url.startsWith("async ")) {
129
+ url = url.slice(6);
130
+ }
131
+ if (url.startsWith("http:") || url.startsWith("https:")) {
132
+ const urlObj = new URL(url);
133
+ urlObj.searchParams.delete("import");
134
+ urlObj.searchParams.delete("browserv");
135
+ url = urlObj.pathname + urlObj.hash + urlObj.search;
136
+ }
137
+ if (url.startsWith("/@fs/")) {
138
+ const isWindows = /^\/@fs\/[a-zA-Z]:\//.test(url);
139
+ url = url.slice(isWindows ? 5 : 4);
140
+ }
141
+ return [url, parts[2] || void 0, parts[3] || void 0];
142
+ }
143
+ function parseSingleFFOrSafariStack(raw) {
144
+ let line = raw.trim();
145
+ if (SAFARI_NATIVE_CODE_REGEXP.test(line)) {
146
+ return null;
147
+ }
148
+ if (line.includes(" > eval")) {
149
+ line = line.replace(
150
+ / line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,
151
+ ":$1"
152
+ );
153
+ }
154
+ if (!line.includes("@") && !line.includes(":")) {
155
+ return null;
156
+ }
157
+ const functionNameRegex = /((.*".+"[^@]*)?[^@]*)(@)/;
158
+ const matches = line.match(functionNameRegex);
159
+ const functionName = matches && matches[1] ? matches[1] : void 0;
160
+ const [url, lineNumber, columnNumber] = extractLocation(
161
+ line.replace(functionNameRegex, "")
162
+ );
163
+ if (!url || !lineNumber || !columnNumber) {
164
+ return null;
165
+ }
166
+ return {
167
+ file: url,
168
+ method: functionName || "",
169
+ line: Number.parseInt(lineNumber),
170
+ column: Number.parseInt(columnNumber)
171
+ };
172
+ }
173
+ function parseSingleStack(raw) {
174
+ const line = raw.trim();
175
+ if (!CHROME_IE_STACK_REGEXP.test(line)) {
176
+ return parseSingleFFOrSafariStack(line);
177
+ }
178
+ return parseSingleV8Stack(line);
179
+ }
180
+ function parseSingleV8Stack(raw) {
181
+ let line = raw.trim();
182
+ if (!CHROME_IE_STACK_REGEXP.test(line)) {
183
+ return null;
184
+ }
185
+ if (line.includes("(eval ")) {
186
+ line = line.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, "");
187
+ }
188
+ let sanitizedLine = line.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, "");
189
+ const location = sanitizedLine.match(/ (\(.+\)$)/);
190
+ sanitizedLine = location ? sanitizedLine.replace(location[0], "") : sanitizedLine;
191
+ const [url, lineNumber, columnNumber] = extractLocation(
192
+ location ? location[1] : sanitizedLine
193
+ );
194
+ let method = location && sanitizedLine || "";
195
+ let file = url && ["eval", "<anonymous>"].includes(url) ? void 0 : url;
196
+ if (!file || !lineNumber || !columnNumber) {
197
+ return null;
198
+ }
199
+ if (method.startsWith("async ")) {
200
+ method = method.slice(6);
201
+ }
202
+ if (file.startsWith("file://")) {
203
+ file = file.slice(7);
204
+ }
205
+ file = file.startsWith("node:") || file.startsWith("internal:") ? file : resolve(file);
206
+ if (method) {
207
+ method = method.replace(/__vite_ssr_import_\d+__\./g, "");
208
+ }
209
+ return {
210
+ method,
211
+ file,
212
+ line: Number.parseInt(lineNumber),
213
+ column: Number.parseInt(columnNumber)
214
+ };
215
+ }
216
+ exports.parseSingleFFOrSafariStack = parseSingleFFOrSafariStack;
217
+ exports.parseSingleStack = parseSingleStack;
218
+ exports.parseSingleV8Stack = parseSingleV8Stack;