@noma.to/qwik-testing-library 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/lib/lib/mock.qwik.cjs +3 -3
- package/lib/lib/mock.qwik.mjs +1 -1
- package/lib/lib/qwikloader.qwik.cjs +1 -1
- package/lib/lib/qwikloader.qwik.mjs +1 -1
- 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@2.1.8}/node_modules/@vitest/expect/dist/index.qwik.cjs +155 -71
- package/lib/node_modules/.pnpm/{@vitest_expect@2.1.1 → @vitest_expect@2.1.8}/node_modules/@vitest/expect/dist/index.qwik.mjs +148 -64
- package/lib/node_modules/.pnpm/{@vitest_pretty-format@2.1.1 → @vitest_pretty-format@2.1.8}/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +11 -5
- package/lib/node_modules/.pnpm/{@vitest_pretty-format@2.1.1 → @vitest_pretty-format@2.1.8}/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +11 -5
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@2.1.8}/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +2 -2
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@2.1.8}/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +2 -2
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@2.1.8}/node_modules/@vitest/runner/dist/index.qwik.cjs +34 -28
- package/lib/node_modules/.pnpm/{@vitest_runner@2.1.1 → @vitest_runner@2.1.8}/node_modules/@vitest/runner/dist/index.qwik.mjs +31 -25
- package/lib/node_modules/.pnpm/{@vitest_snapshot@2.1.1 → @vitest_snapshot@2.1.8}/node_modules/@vitest/snapshot/dist/index.qwik.cjs +863 -460
- package/lib/node_modules/.pnpm/{@vitest_snapshot@2.1.1 → @vitest_snapshot@2.1.8}/node_modules/@vitest/snapshot/dist/index.qwik.mjs +863 -460
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.cjs → @vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.cjs} +6 -2
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.mjs → @vitest_utils@2.1.8/node_modules/@vitest/utils/dist/chunk-_commonjsHelpers.qwik.mjs} +6 -2
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/diff.qwik.cjs +458 -450
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/diff.qwik.mjs +456 -448
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/error.qwik.cjs +5 -5
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/error.qwik.mjs +2 -2
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/helpers.qwik.cjs +1 -1
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/helpers.qwik.mjs +1 -1
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.cjs +472 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.8/node_modules/@vitest/utils/dist/index.qwik.mjs +472 -0
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/node_modules/@vitest/utils/dist/source-map.qwik.cjs +20 -20
- package/lib/node_modules/.pnpm/{@vitest_utils@2.1.1 → @vitest_utils@2.1.8}/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.2}/node_modules/loupe/lib/error.qwik.cjs +7 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/error.qwik.mjs +7 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/object.qwik.cjs +1 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/object.qwik.mjs +1 -1
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/string.qwik.cjs +1 -2
- package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/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/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.cjs +66 -0
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/utils.C8RiOc4B.qwik.mjs +66 -0
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs +2749 -0
- package/lib/node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs +2749 -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/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_spy@2.1.1 → @vitest_spy@2.1.8}/node_modules/@vitest/spy/dist/index.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{@vitest_spy@2.1.1 → @vitest_spy@2.1.8}/node_modules/@vitest/spy/dist/index.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/arguments.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/arguments.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/array.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/array.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/bigint.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/bigint.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/class.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/class.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/date.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/date.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/function.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/function.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/helpers.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/helpers.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/html.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/html.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/index.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/index.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/map.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/map.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/number.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/number.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/promise.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/promise.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/regexp.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/regexp.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/set.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/set.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/symbol.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/symbol.qwik.mjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/typedarray.qwik.cjs +0 -0
- /package/lib/node_modules/.pnpm/{loupe@3.1.1 → loupe@3.1.2}/node_modules/loupe/lib/typedarray.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@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_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@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_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@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_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@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0}/node_modules/vitest/dist/chunks/date.W2xKR2qe.qwik.mjs +0 -0
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ src="https://raw.githubusercontent.com/ianlet/qwik-testing-library/main/high-vol
|
|
|
19
19
|
[![MIT License][license-badge]][license]
|
|
20
20
|
|
|
21
21
|
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
|
|
22
|
-
[](#contributors-)
|
|
23
23
|
<!-- ALL-CONTRIBUTORS-BADGE:END -->
|
|
24
24
|
[![PRs Welcome][prs-badge]][prs]
|
|
25
25
|
[![Code of Conduct][coc-badge]][coc]
|
|
@@ -163,7 +163,7 @@ runner.
|
|
|
163
163
|
If you haven't done so already, add vitest to your project using Qwik CLI:
|
|
164
164
|
|
|
165
165
|
```shell
|
|
166
|
-
npm qwik add vitest
|
|
166
|
+
npm run qwik add vitest
|
|
167
167
|
```
|
|
168
168
|
|
|
169
169
|
After that, we need to configure Vitest so it can run your tests.
|
|
@@ -471,6 +471,7 @@ Thanks goes to these people ([emoji key][emojis]):
|
|
|
471
471
|
<tbody>
|
|
472
472
|
<tr>
|
|
473
473
|
<td align="center" valign="top" width="14.28%"><a href="https://noma.to/"><img src="https://avatars.githubusercontent.com/u/6018732?v=4?s=100" width="100px;" alt="Ian Létourneau"/><br /><sub><b>Ian Létourneau</b></sub></a><br /><a href="https://github.com/ianlet/qwik-testing-library/commits?author=ianlet" title="Code">💻</a> <a href="https://github.com/ianlet/qwik-testing-library/commits?author=ianlet" title="Tests">⚠️</a> <a href="#ideas-ianlet" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/ianlet/qwik-testing-library/commits?author=ianlet" title="Documentation">📖</a> <a href="#example-ianlet" title="Examples">💡</a></td>
|
|
474
|
+
<td align="center" valign="top" width="14.28%"><a href="https://brandonpittman.com"><img src="https://avatars.githubusercontent.com/u/967145?v=4?s=100" width="100px;" alt="Brandon Pittman"/><br /><sub><b>Brandon Pittman</b></sub></a><br /><a href="https://github.com/ianlet/qwik-testing-library/commits?author=brandonpittman" title="Documentation">📖</a></td>
|
|
474
475
|
</tr>
|
|
475
476
|
</tbody>
|
|
476
477
|
<tfoot>
|
|
@@ -508,4 +509,4 @@ qwikly.
|
|
|
508
509
|
|
|
509
510
|
[qwik-baseline]: https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/testing
|
|
510
511
|
|
|
511
|
-
[tl-team]: https://testing-library.com
|
|
512
|
+
[tl-team]: https://testing-library.com
|
package/lib/lib/mock.qwik.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const qwik = require("@builder.io/qwik");
|
|
4
|
-
const
|
|
4
|
+
const vi_DgezovHB = require("../node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.cjs");
|
|
5
5
|
const mockQrl = () => {
|
|
6
|
-
return qwik.$(
|
|
6
|
+
return qwik.$(vi_DgezovHB.v.fn());
|
|
7
7
|
};
|
|
8
8
|
const mock$ = qwik.implicit$FirstArg(mockQrl);
|
|
9
9
|
function clearAllMocks() {
|
|
10
|
-
|
|
10
|
+
vi_DgezovHB.v.clearAllMocks();
|
|
11
11
|
}
|
|
12
12
|
exports.clearAllMocks = clearAllMocks;
|
|
13
13
|
exports.mock$ = mock$;
|
package/lib/lib/mock.qwik.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { implicit$FirstArg, $ } from "@builder.io/qwik";
|
|
2
|
-
import { v as vi } from "../node_modules/.pnpm/vitest@2.1.
|
|
2
|
+
import { v as vi } from "../node_modules/.pnpm/vitest@2.1.8_@types_node@22.10.3_@vitest_ui@2.1.8_jsdom@26.0.0/node_modules/vitest/dist/chunks/vi.DgezovHB.qwik.mjs";
|
|
3
3
|
const mockQrl = () => {
|
|
4
4
|
return $(vi.fn());
|
|
5
5
|
};
|
|
@@ -11,7 +11,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
|
11
11
|
value
|
|
12
12
|
}) : obj[key] = value;
|
|
13
13
|
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b
|
|
14
|
+
for (var prop in b) {
|
|
15
15
|
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
16
16
|
}
|
|
17
17
|
if (__getOwnPropSymbols) {
|
|
@@ -9,7 +9,7 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, {
|
|
|
9
9
|
value
|
|
10
10
|
}) : obj[key] = value;
|
|
11
11
|
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b
|
|
12
|
+
for (var prop in b) {
|
|
13
13
|
__hasOwnProp.call(b, prop) && __defNormalProp(a, prop, b[prop]);
|
|
14
14
|
}
|
|
15
15
|
if (__getOwnPropSymbols) {
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const comma = ",".charCodeAt(0);
|
|
4
|
+
const semicolon = ";".charCodeAt(0);
|
|
5
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
6
|
+
const intToChar = new Uint8Array(64);
|
|
7
|
+
const charToInt = new Uint8Array(128);
|
|
8
|
+
for (let i = 0; i < chars.length; i++) {
|
|
9
|
+
const c = chars.charCodeAt(i);
|
|
10
|
+
intToChar[i] = c;
|
|
11
|
+
charToInt[c] = i;
|
|
12
|
+
}
|
|
13
|
+
function encodeInteger(builder, num, relative) {
|
|
14
|
+
let delta = num - relative;
|
|
15
|
+
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
16
|
+
do {
|
|
17
|
+
let clamped = delta & 31;
|
|
18
|
+
delta >>>= 5;
|
|
19
|
+
if (delta > 0)
|
|
20
|
+
clamped |= 32;
|
|
21
|
+
builder.write(intToChar[clamped]);
|
|
22
|
+
} while (delta > 0);
|
|
23
|
+
return num;
|
|
24
|
+
}
|
|
25
|
+
const bufLength = 1024 * 16;
|
|
26
|
+
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
27
|
+
decode(buf) {
|
|
28
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
29
|
+
return out.toString();
|
|
30
|
+
}
|
|
31
|
+
} : {
|
|
32
|
+
decode(buf) {
|
|
33
|
+
let out = "";
|
|
34
|
+
for (let i = 0; i < buf.length; i++) {
|
|
35
|
+
out += String.fromCharCode(buf[i]);
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
class StringWriter {
|
|
41
|
+
constructor() {
|
|
42
|
+
this.pos = 0;
|
|
43
|
+
this.out = "";
|
|
44
|
+
this.buffer = new Uint8Array(bufLength);
|
|
45
|
+
}
|
|
46
|
+
write(v) {
|
|
47
|
+
const { buffer } = this;
|
|
48
|
+
buffer[this.pos++] = v;
|
|
49
|
+
if (this.pos === bufLength) {
|
|
50
|
+
this.out += td.decode(buffer);
|
|
51
|
+
this.pos = 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
flush() {
|
|
55
|
+
const { buffer, out, pos } = this;
|
|
56
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function encode(decoded) {
|
|
60
|
+
const writer = new StringWriter();
|
|
61
|
+
let sourcesIndex = 0;
|
|
62
|
+
let sourceLine = 0;
|
|
63
|
+
let sourceColumn = 0;
|
|
64
|
+
let namesIndex = 0;
|
|
65
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
66
|
+
const line = decoded[i];
|
|
67
|
+
if (i > 0)
|
|
68
|
+
writer.write(semicolon);
|
|
69
|
+
if (line.length === 0)
|
|
70
|
+
continue;
|
|
71
|
+
let genColumn = 0;
|
|
72
|
+
for (let j = 0; j < line.length; j++) {
|
|
73
|
+
const segment = line[j];
|
|
74
|
+
if (j > 0)
|
|
75
|
+
writer.write(comma);
|
|
76
|
+
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
77
|
+
if (segment.length === 1)
|
|
78
|
+
continue;
|
|
79
|
+
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
80
|
+
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
81
|
+
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
82
|
+
if (segment.length === 4)
|
|
83
|
+
continue;
|
|
84
|
+
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return writer.flush();
|
|
88
|
+
}
|
|
89
|
+
exports.encode = encode;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
const comma = ",".charCodeAt(0);
|
|
2
|
+
const semicolon = ";".charCodeAt(0);
|
|
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
|
+
function encodeInteger(builder, num, relative) {
|
|
12
|
+
let delta = num - relative;
|
|
13
|
+
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
14
|
+
do {
|
|
15
|
+
let clamped = delta & 31;
|
|
16
|
+
delta >>>= 5;
|
|
17
|
+
if (delta > 0)
|
|
18
|
+
clamped |= 32;
|
|
19
|
+
builder.write(intToChar[clamped]);
|
|
20
|
+
} while (delta > 0);
|
|
21
|
+
return num;
|
|
22
|
+
}
|
|
23
|
+
const bufLength = 1024 * 16;
|
|
24
|
+
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
25
|
+
decode(buf) {
|
|
26
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
27
|
+
return out.toString();
|
|
28
|
+
}
|
|
29
|
+
} : {
|
|
30
|
+
decode(buf) {
|
|
31
|
+
let out = "";
|
|
32
|
+
for (let i = 0; i < buf.length; i++) {
|
|
33
|
+
out += String.fromCharCode(buf[i]);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
class StringWriter {
|
|
39
|
+
constructor() {
|
|
40
|
+
this.pos = 0;
|
|
41
|
+
this.out = "";
|
|
42
|
+
this.buffer = new Uint8Array(bufLength);
|
|
43
|
+
}
|
|
44
|
+
write(v) {
|
|
45
|
+
const { buffer } = this;
|
|
46
|
+
buffer[this.pos++] = v;
|
|
47
|
+
if (this.pos === bufLength) {
|
|
48
|
+
this.out += td.decode(buffer);
|
|
49
|
+
this.pos = 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
flush() {
|
|
53
|
+
const { buffer, out, pos } = this;
|
|
54
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function encode(decoded) {
|
|
58
|
+
const writer = new StringWriter();
|
|
59
|
+
let sourcesIndex = 0;
|
|
60
|
+
let sourceLine = 0;
|
|
61
|
+
let sourceColumn = 0;
|
|
62
|
+
let namesIndex = 0;
|
|
63
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
64
|
+
const line = decoded[i];
|
|
65
|
+
if (i > 0)
|
|
66
|
+
writer.write(semicolon);
|
|
67
|
+
if (line.length === 0)
|
|
68
|
+
continue;
|
|
69
|
+
let genColumn = 0;
|
|
70
|
+
for (let j = 0; j < line.length; j++) {
|
|
71
|
+
const segment = line[j];
|
|
72
|
+
if (j > 0)
|
|
73
|
+
writer.write(comma);
|
|
74
|
+
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
75
|
+
if (segment.length === 1)
|
|
76
|
+
continue;
|
|
77
|
+
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
78
|
+
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
79
|
+
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
80
|
+
if (segment.length === 4)
|
|
81
|
+
continue;
|
|
82
|
+
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return writer.flush();
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
encode
|
|
89
|
+
};
|