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