@noma.to/qwik-testing-library 1.2.0 → 1.3.1
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 +4 -3
- package/lib/lib/mock.qwik.cjs +3 -3
- package/lib/lib/mock.qwik.mjs +1 -1
- package/lib/lib/qwik-testing-library.qwik.cjs +2 -2
- package/lib/lib/qwik-testing-library.qwik.mjs +3 -3
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs +89 -0
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs +89 -0
- package/lib/node_modules/.pnpm/{@vitest_expect@2.1.1 → @vitest_expect@3.0.5}/node_modules/@vitest/expect/dist/index.qwik.cjs +321 -97
- package/lib/node_modules/.pnpm/{@vitest_expect@2.1.1 → @vitest_expect@3.0.5}/node_modules/@vitest/expect/dist/index.qwik.mjs +318 -94
- package/lib/node_modules/.pnpm/{@vitest_pretty-format@2.1.1 → @vitest_pretty-format@3.0.5}/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +312 -15
- package/lib/node_modules/.pnpm/{@vitest_pretty-format@2.1.1 → @vitest_pretty-format@3.0.5}/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +317 -20
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +2 -2
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +2 -2
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/index.qwik.cjs +161 -69
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@3.0.5}/node_modules/@vitest/runner/dist/index.qwik.mjs +158 -66
- package/lib/node_modules/.pnpm/{@vitest_snapshot@2.1.1 → @vitest_snapshot@3.0.5}/node_modules/@vitest/snapshot/dist/index.qwik.cjs +976 -538
- package/lib/node_modules/.pnpm/{@vitest_snapshot@2.1.1 → @vitest_snapshot@3.0.5}/node_modules/@vitest/snapshot/dist/index.qwik.mjs +976 -538
- package/lib/node_modules/.pnpm/{@vitest_spy@2.1.1 → @vitest_spy@3.0.5}/node_modules/@vitest/spy/dist/index.qwik.cjs +20 -3
- package/lib/node_modules/.pnpm/{@vitest_spy@2.1.1 → @vitest_spy@3.0.5}/node_modules/@vitest/spy/dist/index.qwik.mjs +20 -3
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.cjs → @vitest_utils@3.0.5/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs} +7 -3
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.mjs → @vitest_utils@3.0.5/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs} +7 -3
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/diff.qwik.cjs +491 -467
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/diff.qwik.mjs +491 -467
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/error.qwik.cjs +6 -6
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/error.qwik.mjs +3 -3
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/index.qwik.cjs +474 -0
- package/lib/node_modules/.pnpm/@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/index.qwik.mjs +474 -0
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/source-map.qwik.cjs +20 -20
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/source-map.qwik.mjs +20 -20
- package/lib/node_modules/.pnpm/{chai@5.1.1 → chai@5.1.2}/node_modules/chai/chai.qwik.cjs +71 -39
- package/lib/node_modules/.pnpm/{chai@5.1.1 → chai@5.1.2}/node_modules/chai/chai.qwik.mjs +71 -39
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/error.qwik.cjs +7 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/error.qwik.mjs +7 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/index.qwik.mjs +6 -6
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/map.qwik.cjs +1 -3
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/map.qwik.mjs +1 -3
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/object.qwik.cjs +1 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/object.qwik.mjs +1 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/string.qwik.cjs +1 -2
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/string.qwik.mjs +1 -2
- package/lib/node_modules/.pnpm/{magic-string@0.30.11 → magic-string@0.30.17}/node_modules/magic-string/dist/magic-string.es.qwik.cjs +44 -33
- package/lib/node_modules/.pnpm/{magic-string@0.30.11 → magic-string@0.30.17}/node_modules/magic-string/dist/magic-string.es.qwik.mjs +44 -33
- package/lib/node_modules/.pnpm/{pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs → pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.qwik.cjs} +2 -2
- package/lib/node_modules/.pnpm/{pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs → pathe@2.0.2/node_modules/pathe/dist/shared/pathe.UZ-hd4nF.qwik.mjs} +2 -2
- package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +4 -0
- package/lib/node_modules/.pnpm/tinyrainbow@2.0.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +5 -0
- 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 +66 -0
- 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 +66 -0
- 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 +2977 -0
- 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 +2977 -0
- package/package.json +13 -13
- package/lib/_virtual/_commonjsHelpers.qwik.cjs +0 -4
- package/lib/_virtual/_commonjsHelpers.qwik.mjs +0 -4
- package/lib/_virtual/sourcemap-codec.umd.qwik.cjs +0 -4
- package/lib/_virtual/sourcemap-codec.umd.qwik.mjs +0 -4
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.cjs +0 -425
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.mjs +0 -425
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.cjs +0 -81
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.mjs +0 -81
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +0 -7
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +0 -8
- package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/base.BlXpj3e_.qwik.cjs +0 -6
- package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/base.BlXpj3e_.qwik.mjs +0 -6
- package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/utils.Ck2hJTRs.qwik.cjs +0 -16
- package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/utils.Ck2hJTRs.qwik.mjs +0 -16
- package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/vi.D6IHiKAI.qwik.cjs +0 -2556
- package/lib/node_modules/.pnpm/vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1/node_modules/vitest/dist/chunks/vi.D6IHiKAI.qwik.mjs +0 -2556
- /package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/helpers.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@3.0.5}/node_modules/@vitest/utils/dist/helpers.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/arguments.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/arguments.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/array.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/array.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/bigint.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/bigint.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/class.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/class.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/date.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/date.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/function.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/function.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/helpers.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/helpers.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/html.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/html.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/index.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/number.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/number.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/promise.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/promise.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/regexp.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/regexp.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/set.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/set.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/symbol.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/symbol.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/typedarray.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.3}/node_modules/loupe/lib/typedarray.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{tinyrainbow@1.2.0 → tinyrainbow@2.0.0}/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{tinyrainbow@1.2.0 → tinyrainbow@2.0.0}/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1 → 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 -0
- /package/lib/node_modules/.pnpm/{vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1 → 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 -0
- /package/lib/node_modules/.pnpm/{vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1 → 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 -0
- /package/lib/node_modules/.pnpm/{vitest@2.1.1_@types_node@22.7.4_@vitest_ui@2.1.1_jsdom@25.0.1 → 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 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
-
const
|
|
3
|
+
const sourcemapCodec = require("../../../../@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.cjs");
|
|
4
4
|
class BitSet {
|
|
5
5
|
constructor(arg) {
|
|
6
6
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -165,10 +165,13 @@ class SourceMap {
|
|
|
165
165
|
this.sources = properties.sources;
|
|
166
166
|
this.sourcesContent = properties.sourcesContent;
|
|
167
167
|
this.names = properties.names;
|
|
168
|
-
this.mappings =
|
|
168
|
+
this.mappings = sourcemapCodec.encode(properties.mappings);
|
|
169
169
|
if (typeof properties.x_google_ignoreList !== "undefined") {
|
|
170
170
|
this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
171
171
|
}
|
|
172
|
+
if (typeof properties.debugId !== "undefined") {
|
|
173
|
+
this.debugId = properties.debugId;
|
|
174
|
+
}
|
|
172
175
|
}
|
|
173
176
|
toString() {
|
|
174
177
|
return JSON.stringify(this);
|
|
@@ -278,22 +281,6 @@ class Mappings {
|
|
|
278
281
|
let first = true;
|
|
279
282
|
let charInHiresBoundary = false;
|
|
280
283
|
while (originalCharIndex < chunk.end) {
|
|
281
|
-
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
282
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
283
|
-
if (this.hires === "boundary") {
|
|
284
|
-
if (wordRegex.test(original[originalCharIndex])) {
|
|
285
|
-
if (!charInHiresBoundary) {
|
|
286
|
-
this.rawSegments.push(segment);
|
|
287
|
-
charInHiresBoundary = true;
|
|
288
|
-
}
|
|
289
|
-
} else {
|
|
290
|
-
this.rawSegments.push(segment);
|
|
291
|
-
charInHiresBoundary = false;
|
|
292
|
-
}
|
|
293
|
-
} else {
|
|
294
|
-
this.rawSegments.push(segment);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
284
|
if (original[originalCharIndex] === "\n") {
|
|
298
285
|
loc.line += 1;
|
|
299
286
|
loc.column = 0;
|
|
@@ -301,7 +288,24 @@ class Mappings {
|
|
|
301
288
|
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
302
289
|
this.generatedCodeColumn = 0;
|
|
303
290
|
first = true;
|
|
291
|
+
charInHiresBoundary = false;
|
|
304
292
|
} else {
|
|
293
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
294
|
+
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
295
|
+
if (this.hires === "boundary") {
|
|
296
|
+
if (wordRegex.test(original[originalCharIndex])) {
|
|
297
|
+
if (!charInHiresBoundary) {
|
|
298
|
+
this.rawSegments.push(segment);
|
|
299
|
+
charInHiresBoundary = true;
|
|
300
|
+
}
|
|
301
|
+
} else {
|
|
302
|
+
this.rawSegments.push(segment);
|
|
303
|
+
charInHiresBoundary = false;
|
|
304
|
+
}
|
|
305
|
+
} else {
|
|
306
|
+
this.rawSegments.push(segment);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
305
309
|
loc.column += 1;
|
|
306
310
|
this.generatedCodeColumn += 1;
|
|
307
311
|
first = false;
|
|
@@ -346,7 +350,8 @@ class MagicString {
|
|
|
346
350
|
sourcemapLocations: { writable: true, value: new BitSet() },
|
|
347
351
|
storedNames: { writable: true, value: {} },
|
|
348
352
|
indentStr: { writable: true, value: void 0 },
|
|
349
|
-
ignoreList: { writable: true, value: options.ignoreList }
|
|
353
|
+
ignoreList: { writable: true, value: options.ignoreList },
|
|
354
|
+
offset: { writable: true, value: options.offset || 0 }
|
|
350
355
|
});
|
|
351
356
|
this.byStart[0] = chunk;
|
|
352
357
|
this.byEnd[string.length] = chunk;
|
|
@@ -360,6 +365,7 @@ class MagicString {
|
|
|
360
365
|
return this;
|
|
361
366
|
}
|
|
362
367
|
appendLeft(index, content) {
|
|
368
|
+
index = index + this.offset;
|
|
363
369
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
364
370
|
this._split(index);
|
|
365
371
|
const chunk = this.byEnd[index];
|
|
@@ -371,6 +377,7 @@ class MagicString {
|
|
|
371
377
|
return this;
|
|
372
378
|
}
|
|
373
379
|
appendRight(index, content) {
|
|
380
|
+
index = index + this.offset;
|
|
374
381
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
375
382
|
this._split(index);
|
|
376
383
|
const chunk = this.byStart[index];
|
|
@@ -382,7 +389,7 @@ class MagicString {
|
|
|
382
389
|
return this;
|
|
383
390
|
}
|
|
384
391
|
clone() {
|
|
385
|
-
const cloned = new MagicString(this.original, { filename: this.filename });
|
|
392
|
+
const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });
|
|
386
393
|
let originalChunk = this.firstChunk;
|
|
387
394
|
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
388
395
|
while (originalChunk) {
|
|
@@ -547,6 +554,9 @@ class MagicString {
|
|
|
547
554
|
return this.prependRight(index, content);
|
|
548
555
|
}
|
|
549
556
|
move(start, end, index) {
|
|
557
|
+
start = start + this.offset;
|
|
558
|
+
end = end + this.offset;
|
|
559
|
+
index = index + this.offset;
|
|
550
560
|
if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
|
|
551
561
|
this._split(start);
|
|
552
562
|
this._split(end);
|
|
@@ -578,6 +588,8 @@ class MagicString {
|
|
|
578
588
|
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
|
|
579
589
|
}
|
|
580
590
|
update(start, end, content, options) {
|
|
591
|
+
start = start + this.offset;
|
|
592
|
+
end = end + this.offset;
|
|
581
593
|
if (typeof content !== "string") throw new TypeError("replacement content must be a string");
|
|
582
594
|
if (this.original.length !== 0) {
|
|
583
595
|
while (start < 0) start += this.original.length;
|
|
@@ -634,6 +646,7 @@ class MagicString {
|
|
|
634
646
|
return this;
|
|
635
647
|
}
|
|
636
648
|
prependLeft(index, content) {
|
|
649
|
+
index = index + this.offset;
|
|
637
650
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
638
651
|
this._split(index);
|
|
639
652
|
const chunk = this.byEnd[index];
|
|
@@ -645,6 +658,7 @@ class MagicString {
|
|
|
645
658
|
return this;
|
|
646
659
|
}
|
|
647
660
|
prependRight(index, content) {
|
|
661
|
+
index = index + this.offset;
|
|
648
662
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
649
663
|
this._split(index);
|
|
650
664
|
const chunk = this.byStart[index];
|
|
@@ -656,6 +670,8 @@ class MagicString {
|
|
|
656
670
|
return this;
|
|
657
671
|
}
|
|
658
672
|
remove(start, end) {
|
|
673
|
+
start = start + this.offset;
|
|
674
|
+
end = end + this.offset;
|
|
659
675
|
if (this.original.length !== 0) {
|
|
660
676
|
while (start < 0) start += this.original.length;
|
|
661
677
|
while (end < 0) end += this.original.length;
|
|
@@ -675,6 +691,8 @@ class MagicString {
|
|
|
675
691
|
return this;
|
|
676
692
|
}
|
|
677
693
|
reset(start, end) {
|
|
694
|
+
start = start + this.offset;
|
|
695
|
+
end = end + this.offset;
|
|
678
696
|
if (this.original.length !== 0) {
|
|
679
697
|
while (start < 0) start += this.original.length;
|
|
680
698
|
while (end < 0) end += this.original.length;
|
|
@@ -728,7 +746,9 @@ class MagicString {
|
|
|
728
746
|
if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
|
|
729
747
|
return this.intro + lineStr;
|
|
730
748
|
}
|
|
731
|
-
slice(start = 0, end = this.original.length) {
|
|
749
|
+
slice(start = 0, end = this.original.length - this.offset) {
|
|
750
|
+
start = start + this.offset;
|
|
751
|
+
end = end + this.offset;
|
|
732
752
|
if (this.original.length !== 0) {
|
|
733
753
|
while (start < 0) start += this.original.length;
|
|
734
754
|
while (end < 0) end += this.original.length;
|
|
@@ -905,11 +925,7 @@ class MagicString {
|
|
|
905
925
|
if (match.index != null) {
|
|
906
926
|
const replacement2 = getReplacement(match, this.original);
|
|
907
927
|
if (replacement2 !== match[0]) {
|
|
908
|
-
this.overwrite(
|
|
909
|
-
match.index,
|
|
910
|
-
match.index + match[0].length,
|
|
911
|
-
replacement2
|
|
912
|
-
);
|
|
928
|
+
this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
913
929
|
}
|
|
914
930
|
}
|
|
915
931
|
});
|
|
@@ -918,11 +934,7 @@ class MagicString {
|
|
|
918
934
|
if (match && match.index != null) {
|
|
919
935
|
const replacement2 = getReplacement(match, this.original);
|
|
920
936
|
if (replacement2 !== match[0]) {
|
|
921
|
-
this.overwrite(
|
|
922
|
-
match.index,
|
|
923
|
-
match.index + match[0].length,
|
|
924
|
-
replacement2
|
|
925
|
-
);
|
|
937
|
+
this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
926
938
|
}
|
|
927
939
|
}
|
|
928
940
|
}
|
|
@@ -947,8 +959,7 @@ class MagicString {
|
|
|
947
959
|
const stringLength = string.length;
|
|
948
960
|
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
949
961
|
const previous = original.slice(index, index + stringLength);
|
|
950
|
-
if (previous !== replacement)
|
|
951
|
-
this.overwrite(index, index + stringLength, replacement);
|
|
962
|
+
if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
|
|
952
963
|
}
|
|
953
964
|
return this;
|
|
954
965
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { encode } from "../../../../@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.qwik.mjs";
|
|
2
2
|
class BitSet {
|
|
3
3
|
constructor(arg) {
|
|
4
4
|
this.bits = arg instanceof BitSet ? arg.bits.slice() : [];
|
|
@@ -163,10 +163,13 @@ class SourceMap {
|
|
|
163
163
|
this.sources = properties.sources;
|
|
164
164
|
this.sourcesContent = properties.sourcesContent;
|
|
165
165
|
this.names = properties.names;
|
|
166
|
-
this.mappings =
|
|
166
|
+
this.mappings = encode(properties.mappings);
|
|
167
167
|
if (typeof properties.x_google_ignoreList !== "undefined") {
|
|
168
168
|
this.x_google_ignoreList = properties.x_google_ignoreList;
|
|
169
169
|
}
|
|
170
|
+
if (typeof properties.debugId !== "undefined") {
|
|
171
|
+
this.debugId = properties.debugId;
|
|
172
|
+
}
|
|
170
173
|
}
|
|
171
174
|
toString() {
|
|
172
175
|
return JSON.stringify(this);
|
|
@@ -276,22 +279,6 @@ class Mappings {
|
|
|
276
279
|
let first = true;
|
|
277
280
|
let charInHiresBoundary = false;
|
|
278
281
|
while (originalCharIndex < chunk.end) {
|
|
279
|
-
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
280
|
-
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
281
|
-
if (this.hires === "boundary") {
|
|
282
|
-
if (wordRegex.test(original[originalCharIndex])) {
|
|
283
|
-
if (!charInHiresBoundary) {
|
|
284
|
-
this.rawSegments.push(segment);
|
|
285
|
-
charInHiresBoundary = true;
|
|
286
|
-
}
|
|
287
|
-
} else {
|
|
288
|
-
this.rawSegments.push(segment);
|
|
289
|
-
charInHiresBoundary = false;
|
|
290
|
-
}
|
|
291
|
-
} else {
|
|
292
|
-
this.rawSegments.push(segment);
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
282
|
if (original[originalCharIndex] === "\n") {
|
|
296
283
|
loc.line += 1;
|
|
297
284
|
loc.column = 0;
|
|
@@ -299,7 +286,24 @@ class Mappings {
|
|
|
299
286
|
this.raw[this.generatedCodeLine] = this.rawSegments = [];
|
|
300
287
|
this.generatedCodeColumn = 0;
|
|
301
288
|
first = true;
|
|
289
|
+
charInHiresBoundary = false;
|
|
302
290
|
} else {
|
|
291
|
+
if (this.hires || first || sourcemapLocations.has(originalCharIndex)) {
|
|
292
|
+
const segment = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column];
|
|
293
|
+
if (this.hires === "boundary") {
|
|
294
|
+
if (wordRegex.test(original[originalCharIndex])) {
|
|
295
|
+
if (!charInHiresBoundary) {
|
|
296
|
+
this.rawSegments.push(segment);
|
|
297
|
+
charInHiresBoundary = true;
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
this.rawSegments.push(segment);
|
|
301
|
+
charInHiresBoundary = false;
|
|
302
|
+
}
|
|
303
|
+
} else {
|
|
304
|
+
this.rawSegments.push(segment);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
303
307
|
loc.column += 1;
|
|
304
308
|
this.generatedCodeColumn += 1;
|
|
305
309
|
first = false;
|
|
@@ -344,7 +348,8 @@ class MagicString {
|
|
|
344
348
|
sourcemapLocations: { writable: true, value: new BitSet() },
|
|
345
349
|
storedNames: { writable: true, value: {} },
|
|
346
350
|
indentStr: { writable: true, value: void 0 },
|
|
347
|
-
ignoreList: { writable: true, value: options.ignoreList }
|
|
351
|
+
ignoreList: { writable: true, value: options.ignoreList },
|
|
352
|
+
offset: { writable: true, value: options.offset || 0 }
|
|
348
353
|
});
|
|
349
354
|
this.byStart[0] = chunk;
|
|
350
355
|
this.byEnd[string.length] = chunk;
|
|
@@ -358,6 +363,7 @@ class MagicString {
|
|
|
358
363
|
return this;
|
|
359
364
|
}
|
|
360
365
|
appendLeft(index, content) {
|
|
366
|
+
index = index + this.offset;
|
|
361
367
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
362
368
|
this._split(index);
|
|
363
369
|
const chunk = this.byEnd[index];
|
|
@@ -369,6 +375,7 @@ class MagicString {
|
|
|
369
375
|
return this;
|
|
370
376
|
}
|
|
371
377
|
appendRight(index, content) {
|
|
378
|
+
index = index + this.offset;
|
|
372
379
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
373
380
|
this._split(index);
|
|
374
381
|
const chunk = this.byStart[index];
|
|
@@ -380,7 +387,7 @@ class MagicString {
|
|
|
380
387
|
return this;
|
|
381
388
|
}
|
|
382
389
|
clone() {
|
|
383
|
-
const cloned = new MagicString(this.original, { filename: this.filename });
|
|
390
|
+
const cloned = new MagicString(this.original, { filename: this.filename, offset: this.offset });
|
|
384
391
|
let originalChunk = this.firstChunk;
|
|
385
392
|
let clonedChunk = cloned.firstChunk = cloned.lastSearchedChunk = originalChunk.clone();
|
|
386
393
|
while (originalChunk) {
|
|
@@ -545,6 +552,9 @@ class MagicString {
|
|
|
545
552
|
return this.prependRight(index, content);
|
|
546
553
|
}
|
|
547
554
|
move(start, end, index) {
|
|
555
|
+
start = start + this.offset;
|
|
556
|
+
end = end + this.offset;
|
|
557
|
+
index = index + this.offset;
|
|
548
558
|
if (index >= start && index <= end) throw new Error("Cannot move a selection inside itself");
|
|
549
559
|
this._split(start);
|
|
550
560
|
this._split(end);
|
|
@@ -576,6 +586,8 @@ class MagicString {
|
|
|
576
586
|
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
|
|
577
587
|
}
|
|
578
588
|
update(start, end, content, options) {
|
|
589
|
+
start = start + this.offset;
|
|
590
|
+
end = end + this.offset;
|
|
579
591
|
if (typeof content !== "string") throw new TypeError("replacement content must be a string");
|
|
580
592
|
if (this.original.length !== 0) {
|
|
581
593
|
while (start < 0) start += this.original.length;
|
|
@@ -632,6 +644,7 @@ class MagicString {
|
|
|
632
644
|
return this;
|
|
633
645
|
}
|
|
634
646
|
prependLeft(index, content) {
|
|
647
|
+
index = index + this.offset;
|
|
635
648
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
636
649
|
this._split(index);
|
|
637
650
|
const chunk = this.byEnd[index];
|
|
@@ -643,6 +656,7 @@ class MagicString {
|
|
|
643
656
|
return this;
|
|
644
657
|
}
|
|
645
658
|
prependRight(index, content) {
|
|
659
|
+
index = index + this.offset;
|
|
646
660
|
if (typeof content !== "string") throw new TypeError("inserted content must be a string");
|
|
647
661
|
this._split(index);
|
|
648
662
|
const chunk = this.byStart[index];
|
|
@@ -654,6 +668,8 @@ class MagicString {
|
|
|
654
668
|
return this;
|
|
655
669
|
}
|
|
656
670
|
remove(start, end) {
|
|
671
|
+
start = start + this.offset;
|
|
672
|
+
end = end + this.offset;
|
|
657
673
|
if (this.original.length !== 0) {
|
|
658
674
|
while (start < 0) start += this.original.length;
|
|
659
675
|
while (end < 0) end += this.original.length;
|
|
@@ -673,6 +689,8 @@ class MagicString {
|
|
|
673
689
|
return this;
|
|
674
690
|
}
|
|
675
691
|
reset(start, end) {
|
|
692
|
+
start = start + this.offset;
|
|
693
|
+
end = end + this.offset;
|
|
676
694
|
if (this.original.length !== 0) {
|
|
677
695
|
while (start < 0) start += this.original.length;
|
|
678
696
|
while (end < 0) end += this.original.length;
|
|
@@ -726,7 +744,9 @@ class MagicString {
|
|
|
726
744
|
if (lineIndex !== -1) return this.intro.substr(lineIndex + 1) + lineStr;
|
|
727
745
|
return this.intro + lineStr;
|
|
728
746
|
}
|
|
729
|
-
slice(start = 0, end = this.original.length) {
|
|
747
|
+
slice(start = 0, end = this.original.length - this.offset) {
|
|
748
|
+
start = start + this.offset;
|
|
749
|
+
end = end + this.offset;
|
|
730
750
|
if (this.original.length !== 0) {
|
|
731
751
|
while (start < 0) start += this.original.length;
|
|
732
752
|
while (end < 0) end += this.original.length;
|
|
@@ -903,11 +923,7 @@ class MagicString {
|
|
|
903
923
|
if (match.index != null) {
|
|
904
924
|
const replacement2 = getReplacement(match, this.original);
|
|
905
925
|
if (replacement2 !== match[0]) {
|
|
906
|
-
this.overwrite(
|
|
907
|
-
match.index,
|
|
908
|
-
match.index + match[0].length,
|
|
909
|
-
replacement2
|
|
910
|
-
);
|
|
926
|
+
this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
911
927
|
}
|
|
912
928
|
}
|
|
913
929
|
});
|
|
@@ -916,11 +932,7 @@ class MagicString {
|
|
|
916
932
|
if (match && match.index != null) {
|
|
917
933
|
const replacement2 = getReplacement(match, this.original);
|
|
918
934
|
if (replacement2 !== match[0]) {
|
|
919
|
-
this.overwrite(
|
|
920
|
-
match.index,
|
|
921
|
-
match.index + match[0].length,
|
|
922
|
-
replacement2
|
|
923
|
-
);
|
|
935
|
+
this.overwrite(match.index, match.index + match[0].length, replacement2);
|
|
924
936
|
}
|
|
925
937
|
}
|
|
926
938
|
}
|
|
@@ -945,8 +957,7 @@ class MagicString {
|
|
|
945
957
|
const stringLength = string.length;
|
|
946
958
|
for (let index = original.indexOf(string); index !== -1; index = original.indexOf(string, index + stringLength)) {
|
|
947
959
|
const previous = original.slice(index, index + stringLength);
|
|
948
|
-
if (previous !== replacement)
|
|
949
|
-
this.overwrite(index, index + stringLength, replacement);
|
|
960
|
+
if (previous !== replacement) this.overwrite(index, index + stringLength, replacement);
|
|
950
961
|
}
|
|
951
962
|
return this;
|
|
952
963
|
}
|
|
@@ -95,7 +95,7 @@ function normalizeString(path, allowAboveRoot) {
|
|
|
95
95
|
const isAbsolute = function(p) {
|
|
96
96
|
return _IS_ABSOLUTE_RE.test(p);
|
|
97
97
|
};
|
|
98
|
-
exports.
|
|
98
|
+
exports.a = normalizeString;
|
|
99
|
+
exports.g = normalizeWindowsPath;
|
|
99
100
|
exports.i = isAbsolute;
|
|
100
|
-
exports.n = normalizeWindowsPath;
|
|
101
101
|
exports.r = resolve;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const index = require("../../../../../@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/index.qwik.cjs");
|
|
4
|
+
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
5
|
+
function getWorkerState() {
|
|
6
|
+
const workerState = globalThis[NAME_WORKER_STATE];
|
|
7
|
+
if (!workerState) {
|
|
8
|
+
const errorMsg = 'Vitest failed to access its internal state.\n\nOne of the following is possible:\n- "vitest" is imported directly without running "vitest" command\n- "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n';
|
|
9
|
+
throw new Error(errorMsg);
|
|
10
|
+
}
|
|
11
|
+
return workerState;
|
|
12
|
+
}
|
|
13
|
+
function getCurrentEnvironment() {
|
|
14
|
+
const state = getWorkerState();
|
|
15
|
+
return state?.environment.name;
|
|
16
|
+
}
|
|
17
|
+
function isChildProcess() {
|
|
18
|
+
return typeof process !== "undefined" && !!process.send;
|
|
19
|
+
}
|
|
20
|
+
function resetModules(modules, resetMocks = false) {
|
|
21
|
+
const skipPaths = [
|
|
22
|
+
// Vitest
|
|
23
|
+
/\/vitest\/dist\//,
|
|
24
|
+
/\/vite-node\/dist\//,
|
|
25
|
+
// yarn's .store folder
|
|
26
|
+
/vitest-virtual-\w+\/dist/,
|
|
27
|
+
// cnpm
|
|
28
|
+
/@vitest\/dist/,
|
|
29
|
+
// don't clear mocks
|
|
30
|
+
...!resetMocks ? [/^mock:/] : []
|
|
31
|
+
];
|
|
32
|
+
modules.forEach((mod, path) => {
|
|
33
|
+
if (skipPaths.some((re) => re.test(path))) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
modules.invalidateModule(mod);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
function waitNextTick() {
|
|
40
|
+
const { setTimeout } = index.getSafeTimers();
|
|
41
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
42
|
+
}
|
|
43
|
+
async function waitForImportsToResolve() {
|
|
44
|
+
await waitNextTick();
|
|
45
|
+
const state = getWorkerState();
|
|
46
|
+
const promises = [];
|
|
47
|
+
let resolvingCount = 0;
|
|
48
|
+
for (const mod of state.moduleCache.values()) {
|
|
49
|
+
if (mod.promise && !mod.evaluated) {
|
|
50
|
+
promises.push(mod.promise);
|
|
51
|
+
}
|
|
52
|
+
if (mod.resolving) {
|
|
53
|
+
resolvingCount++;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
if (!promises.length && !resolvingCount) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
await Promise.allSettled(promises);
|
|
60
|
+
await waitForImportsToResolve();
|
|
61
|
+
}
|
|
62
|
+
exports.a = getCurrentEnvironment;
|
|
63
|
+
exports.g = getWorkerState;
|
|
64
|
+
exports.i = isChildProcess;
|
|
65
|
+
exports.r = resetModules;
|
|
66
|
+
exports.w = waitForImportsToResolve;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { getSafeTimers } from "../../../../../@vitest_utils@3.0.5/node_modules/@vitest/utils/dist/index.qwik.mjs";
|
|
2
|
+
const NAME_WORKER_STATE = "__vitest_worker__";
|
|
3
|
+
function getWorkerState() {
|
|
4
|
+
const workerState = globalThis[NAME_WORKER_STATE];
|
|
5
|
+
if (!workerState) {
|
|
6
|
+
const errorMsg = 'Vitest failed to access its internal state.\n\nOne of the following is possible:\n- "vitest" is imported directly without running "vitest" command\n- "vitest" is imported inside "globalSetup" (to fix this, use "setupFiles" instead, because "globalSetup" runs in a different context)\n- Otherwise, it might be a Vitest bug. Please report it to https://github.com/vitest-dev/vitest/issues\n';
|
|
7
|
+
throw new Error(errorMsg);
|
|
8
|
+
}
|
|
9
|
+
return workerState;
|
|
10
|
+
}
|
|
11
|
+
function getCurrentEnvironment() {
|
|
12
|
+
const state = getWorkerState();
|
|
13
|
+
return state?.environment.name;
|
|
14
|
+
}
|
|
15
|
+
function isChildProcess() {
|
|
16
|
+
return typeof process !== "undefined" && !!process.send;
|
|
17
|
+
}
|
|
18
|
+
function resetModules(modules, resetMocks = false) {
|
|
19
|
+
const skipPaths = [
|
|
20
|
+
// Vitest
|
|
21
|
+
/\/vitest\/dist\//,
|
|
22
|
+
/\/vite-node\/dist\//,
|
|
23
|
+
// yarn's .store folder
|
|
24
|
+
/vitest-virtual-\w+\/dist/,
|
|
25
|
+
// cnpm
|
|
26
|
+
/@vitest\/dist/,
|
|
27
|
+
// don't clear mocks
|
|
28
|
+
...!resetMocks ? [/^mock:/] : []
|
|
29
|
+
];
|
|
30
|
+
modules.forEach((mod, path) => {
|
|
31
|
+
if (skipPaths.some((re) => re.test(path))) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
modules.invalidateModule(mod);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function waitNextTick() {
|
|
38
|
+
const { setTimeout } = getSafeTimers();
|
|
39
|
+
return new Promise((resolve) => setTimeout(resolve, 0));
|
|
40
|
+
}
|
|
41
|
+
async function waitForImportsToResolve() {
|
|
42
|
+
await waitNextTick();
|
|
43
|
+
const state = getWorkerState();
|
|
44
|
+
const promises = [];
|
|
45
|
+
let resolvingCount = 0;
|
|
46
|
+
for (const mod of state.moduleCache.values()) {
|
|
47
|
+
if (mod.promise && !mod.evaluated) {
|
|
48
|
+
promises.push(mod.promise);
|
|
49
|
+
}
|
|
50
|
+
if (mod.resolving) {
|
|
51
|
+
resolvingCount++;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (!promises.length && !resolvingCount) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
await Promise.allSettled(promises);
|
|
58
|
+
await waitForImportsToResolve();
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
getCurrentEnvironment as a,
|
|
62
|
+
getWorkerState as g,
|
|
63
|
+
isChildProcess as i,
|
|
64
|
+
resetModules as r,
|
|
65
|
+
waitForImportsToResolve as w
|
|
66
|
+
};
|