@noma.to/qwik-testing-library 1.0.3 → 1.1.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 +120 -7
- package/lib/_virtual/_commonjsHelpers.qwik.cjs +2 -0
- package/lib/_virtual/_commonjsHelpers.qwik.mjs +2 -0
- package/lib/_virtual/sourcemap-codec.umd.qwik.cjs +4 -0
- package/lib/_virtual/sourcemap-codec.umd.qwik.mjs +4 -0
- package/lib/index.qwik.cjs +4 -0
- package/lib/index.qwik.mjs +4 -0
- package/lib/lib/mock.qwik.cjs +14 -0
- package/lib/lib/mock.qwik.mjs +14 -0
- package/lib/lib/qwik-testing-library.qwik.cjs +4 -0
- package/lib/lib/qwik-testing-library.qwik.mjs +4 -0
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.cjs +425 -0
- package/lib/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.0/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.umd.qwik.mjs +425 -0
- package/lib/node_modules/.pnpm/@vitest_expect@2.1.1/node_modules/@vitest/expect/dist/index.qwik.cjs +1967 -0
- package/lib/node_modules/.pnpm/@vitest_expect@2.1.1/node_modules/@vitest/expect/dist/index.qwik.mjs +1967 -0
- package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.1/node_modules/@vitest/pretty-format/dist/index.qwik.cjs +1202 -0
- package/lib/node_modules/.pnpm/@vitest_pretty-format@2.1.1/node_modules/@vitest/pretty-format/dist/index.qwik.mjs +1202 -0
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/chunk-tasks.qwik.cjs +44 -0
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/chunk-tasks.qwik.mjs +44 -0
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/index.qwik.cjs +665 -0
- package/lib/node_modules/.pnpm/@vitest_runner@2.1.1/node_modules/@vitest/runner/dist/index.qwik.mjs +665 -0
- package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.1/node_modules/@vitest/snapshot/dist/index.qwik.cjs +1641 -0
- package/lib/node_modules/.pnpm/@vitest_snapshot@2.1.1/node_modules/@vitest/snapshot/dist/index.qwik.mjs +1641 -0
- package/lib/node_modules/.pnpm/@vitest_spy@2.1.1/node_modules/@vitest/spy/dist/index.qwik.cjs +148 -0
- package/lib/node_modules/.pnpm/@vitest_spy@2.1.1/node_modules/@vitest/spy/dist/index.qwik.mjs +148 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.cjs +158 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/chunk-display.qwik.mjs +158 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/diff.qwik.cjs +1731 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/diff.qwik.mjs +1731 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/error.qwik.cjs +137 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/error.qwik.mjs +137 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/helpers.qwik.cjs +150 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/helpers.qwik.mjs +150 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.cjs +81 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/index.qwik.mjs +81 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/source-map.qwik.cjs +216 -0
- package/lib/node_modules/.pnpm/@vitest_utils@2.1.1/node_modules/@vitest/utils/dist/source-map.qwik.mjs +216 -0
- package/lib/node_modules/.pnpm/chai@5.1.1/node_modules/chai/chai.qwik.cjs +3905 -0
- package/lib/node_modules/.pnpm/chai@5.1.1/node_modules/chai/chai.qwik.mjs +3905 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/arguments.qwik.cjs +9 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/arguments.qwik.mjs +10 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/array.qwik.cjs +16 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/array.qwik.mjs +17 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/bigint.qwik.cjs +9 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/bigint.qwik.mjs +10 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/class.qwik.cjs +16 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/class.qwik.mjs +17 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/date.qwik.cjs +12 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/date.qwik.mjs +13 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/error.qwik.cjs +30 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/error.qwik.mjs +31 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/function.qwik.cjs +11 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/function.qwik.mjs +12 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/helpers.qwik.cjs +160 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/helpers.qwik.mjs +160 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/html.qwik.cjs +36 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/html.qwik.mjs +36 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/index.qwik.cjs +130 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/index.qwik.mjs +130 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/map.qwik.cjs +25 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/map.qwik.mjs +26 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/number.qwik.cjs +19 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/number.qwik.mjs +20 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/object.qwik.cjs +24 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/object.qwik.mjs +25 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/promise.qwik.cjs +17 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/promise.qwik.mjs +18 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/regexp.qwik.cjs +9 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/regexp.qwik.mjs +10 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/set.qwik.cjs +16 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/set.qwik.mjs +17 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/string.qwik.cjs +24 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/string.qwik.mjs +25 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/symbol.qwik.cjs +8 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/symbol.qwik.mjs +9 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/typedarray.qwik.cjs +34 -0
- package/lib/node_modules/.pnpm/loupe@3.1.1/node_modules/loupe/lib/typedarray.qwik.mjs +35 -0
- package/lib/node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.qwik.cjs +968 -0
- package/lib/node_modules/.pnpm/magic-string@0.30.11/node_modules/magic-string/dist/magic-string.es.qwik.mjs +968 -0
- package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.cjs +101 -0
- package/lib/node_modules/.pnpm/pathe@1.1.2/node_modules/pathe/dist/shared/pathe.ff20891b.qwik.mjs +101 -0
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.cjs +7 -0
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/browser.qwik.mjs +8 -0
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.cjs +80 -0
- package/lib/node_modules/.pnpm/tinyrainbow@1.2.0/node_modules/tinyrainbow/dist/chunk-BVHSVHOK.qwik.mjs +80 -0
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.cjs +104 -0
- package/lib/node_modules/.pnpm/tinyspy@3.0.2/node_modules/tinyspy/dist/index.qwik.mjs +104 -0
- 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/_commonjsHelpers.BFTU3MAI.qwik.cjs +8 -0
- 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/_commonjsHelpers.BFTU3MAI.qwik.mjs +8 -0
- 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 +6 -0
- 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 +6 -0
- 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/date.W2xKR2qe.qwik.cjs +56 -0
- 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/date.W2xKR2qe.qwik.mjs +56 -0
- 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 +16 -0
- 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 +16 -0
- 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 +2556 -0
- 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 +2556 -0
- package/lib-types/lib/mock.d.ts +34 -0
- package/lib-types/lib/qwik-testing-library.d.ts +2 -1
- package/package.json +9 -8
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const _commonjsHelpers = require("../../../../../../../_virtual/_commonjsHelpers.qwik.cjs");
|
|
4
|
+
const sourcemapCodec_umd = require("../../../../../../../_virtual/sourcemap-codec.umd.qwik.cjs");
|
|
5
|
+
(function(module2, exports2) {
|
|
6
|
+
(function(global, factory) {
|
|
7
|
+
factory(exports2);
|
|
8
|
+
})(_commonjsHelpers.commonjsGlobal, function(exports3) {
|
|
9
|
+
const comma = ",".charCodeAt(0);
|
|
10
|
+
const semicolon = ";".charCodeAt(0);
|
|
11
|
+
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
12
|
+
const intToChar = new Uint8Array(64);
|
|
13
|
+
const charToInt = new Uint8Array(128);
|
|
14
|
+
for (let i = 0; i < chars.length; i++) {
|
|
15
|
+
const c = chars.charCodeAt(i);
|
|
16
|
+
intToChar[i] = c;
|
|
17
|
+
charToInt[c] = i;
|
|
18
|
+
}
|
|
19
|
+
function decodeInteger(reader, relative) {
|
|
20
|
+
let value = 0;
|
|
21
|
+
let shift = 0;
|
|
22
|
+
let integer = 0;
|
|
23
|
+
do {
|
|
24
|
+
const c = reader.next();
|
|
25
|
+
integer = charToInt[c];
|
|
26
|
+
value |= (integer & 31) << shift;
|
|
27
|
+
shift += 5;
|
|
28
|
+
} while (integer & 32);
|
|
29
|
+
const shouldNegate = value & 1;
|
|
30
|
+
value >>>= 1;
|
|
31
|
+
if (shouldNegate) {
|
|
32
|
+
value = -2147483648 | -value;
|
|
33
|
+
}
|
|
34
|
+
return relative + value;
|
|
35
|
+
}
|
|
36
|
+
function encodeInteger(builder, num, relative) {
|
|
37
|
+
let delta = num - relative;
|
|
38
|
+
delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
|
|
39
|
+
do {
|
|
40
|
+
let clamped = delta & 31;
|
|
41
|
+
delta >>>= 5;
|
|
42
|
+
if (delta > 0)
|
|
43
|
+
clamped |= 32;
|
|
44
|
+
builder.write(intToChar[clamped]);
|
|
45
|
+
} while (delta > 0);
|
|
46
|
+
return num;
|
|
47
|
+
}
|
|
48
|
+
function hasMoreVlq(reader, max) {
|
|
49
|
+
if (reader.pos >= max)
|
|
50
|
+
return false;
|
|
51
|
+
return reader.peek() !== comma;
|
|
52
|
+
}
|
|
53
|
+
const bufLength = 1024 * 16;
|
|
54
|
+
const td = typeof TextDecoder !== "undefined" ? /* @__PURE__ */ new TextDecoder() : typeof Buffer !== "undefined" ? {
|
|
55
|
+
decode(buf) {
|
|
56
|
+
const out = Buffer.from(buf.buffer, buf.byteOffset, buf.byteLength);
|
|
57
|
+
return out.toString();
|
|
58
|
+
}
|
|
59
|
+
} : {
|
|
60
|
+
decode(buf) {
|
|
61
|
+
let out = "";
|
|
62
|
+
for (let i = 0; i < buf.length; i++) {
|
|
63
|
+
out += String.fromCharCode(buf[i]);
|
|
64
|
+
}
|
|
65
|
+
return out;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
class StringWriter {
|
|
69
|
+
constructor() {
|
|
70
|
+
this.pos = 0;
|
|
71
|
+
this.out = "";
|
|
72
|
+
this.buffer = new Uint8Array(bufLength);
|
|
73
|
+
}
|
|
74
|
+
write(v) {
|
|
75
|
+
const { buffer } = this;
|
|
76
|
+
buffer[this.pos++] = v;
|
|
77
|
+
if (this.pos === bufLength) {
|
|
78
|
+
this.out += td.decode(buffer);
|
|
79
|
+
this.pos = 0;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
flush() {
|
|
83
|
+
const { buffer, out, pos } = this;
|
|
84
|
+
return pos > 0 ? out + td.decode(buffer.subarray(0, pos)) : out;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
class StringReader {
|
|
88
|
+
constructor(buffer) {
|
|
89
|
+
this.pos = 0;
|
|
90
|
+
this.buffer = buffer;
|
|
91
|
+
}
|
|
92
|
+
next() {
|
|
93
|
+
return this.buffer.charCodeAt(this.pos++);
|
|
94
|
+
}
|
|
95
|
+
peek() {
|
|
96
|
+
return this.buffer.charCodeAt(this.pos);
|
|
97
|
+
}
|
|
98
|
+
indexOf(char) {
|
|
99
|
+
const { buffer, pos } = this;
|
|
100
|
+
const idx = buffer.indexOf(char, pos);
|
|
101
|
+
return idx === -1 ? buffer.length : idx;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
const EMPTY = [];
|
|
105
|
+
function decodeOriginalScopes(input) {
|
|
106
|
+
const { length } = input;
|
|
107
|
+
const reader = new StringReader(input);
|
|
108
|
+
const scopes = [];
|
|
109
|
+
const stack = [];
|
|
110
|
+
let line = 0;
|
|
111
|
+
for (; reader.pos < length; reader.pos++) {
|
|
112
|
+
line = decodeInteger(reader, line);
|
|
113
|
+
const column = decodeInteger(reader, 0);
|
|
114
|
+
if (!hasMoreVlq(reader, length)) {
|
|
115
|
+
const last = stack.pop();
|
|
116
|
+
last[2] = line;
|
|
117
|
+
last[3] = column;
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const kind = decodeInteger(reader, 0);
|
|
121
|
+
const fields = decodeInteger(reader, 0);
|
|
122
|
+
const hasName = fields & 1;
|
|
123
|
+
const scope = hasName ? [line, column, 0, 0, kind, decodeInteger(reader, 0)] : [line, column, 0, 0, kind];
|
|
124
|
+
let vars = EMPTY;
|
|
125
|
+
if (hasMoreVlq(reader, length)) {
|
|
126
|
+
vars = [];
|
|
127
|
+
do {
|
|
128
|
+
const varsIndex = decodeInteger(reader, 0);
|
|
129
|
+
vars.push(varsIndex);
|
|
130
|
+
} while (hasMoreVlq(reader, length));
|
|
131
|
+
}
|
|
132
|
+
scope.vars = vars;
|
|
133
|
+
scopes.push(scope);
|
|
134
|
+
stack.push(scope);
|
|
135
|
+
}
|
|
136
|
+
return scopes;
|
|
137
|
+
}
|
|
138
|
+
function encodeOriginalScopes(scopes) {
|
|
139
|
+
const writer = new StringWriter();
|
|
140
|
+
for (let i = 0; i < scopes.length; ) {
|
|
141
|
+
i = _encodeOriginalScopes(scopes, i, writer, [0]);
|
|
142
|
+
}
|
|
143
|
+
return writer.flush();
|
|
144
|
+
}
|
|
145
|
+
function _encodeOriginalScopes(scopes, index, writer, state) {
|
|
146
|
+
const scope = scopes[index];
|
|
147
|
+
const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, 4: kind, vars } = scope;
|
|
148
|
+
if (index > 0)
|
|
149
|
+
writer.write(comma);
|
|
150
|
+
state[0] = encodeInteger(writer, startLine, state[0]);
|
|
151
|
+
encodeInteger(writer, startColumn, 0);
|
|
152
|
+
encodeInteger(writer, kind, 0);
|
|
153
|
+
const fields = scope.length === 6 ? 1 : 0;
|
|
154
|
+
encodeInteger(writer, fields, 0);
|
|
155
|
+
if (scope.length === 6)
|
|
156
|
+
encodeInteger(writer, scope[5], 0);
|
|
157
|
+
for (const v of vars) {
|
|
158
|
+
encodeInteger(writer, v, 0);
|
|
159
|
+
}
|
|
160
|
+
for (index++; index < scopes.length; ) {
|
|
161
|
+
const next = scopes[index];
|
|
162
|
+
const { 0: l, 1: c } = next;
|
|
163
|
+
if (l > endLine || l === endLine && c >= endColumn) {
|
|
164
|
+
break;
|
|
165
|
+
}
|
|
166
|
+
index = _encodeOriginalScopes(scopes, index, writer, state);
|
|
167
|
+
}
|
|
168
|
+
writer.write(comma);
|
|
169
|
+
state[0] = encodeInteger(writer, endLine, state[0]);
|
|
170
|
+
encodeInteger(writer, endColumn, 0);
|
|
171
|
+
return index;
|
|
172
|
+
}
|
|
173
|
+
function decodeGeneratedRanges(input) {
|
|
174
|
+
const { length } = input;
|
|
175
|
+
const reader = new StringReader(input);
|
|
176
|
+
const ranges = [];
|
|
177
|
+
const stack = [];
|
|
178
|
+
let genLine = 0;
|
|
179
|
+
let definitionSourcesIndex = 0;
|
|
180
|
+
let definitionScopeIndex = 0;
|
|
181
|
+
let callsiteSourcesIndex = 0;
|
|
182
|
+
let callsiteLine = 0;
|
|
183
|
+
let callsiteColumn = 0;
|
|
184
|
+
let bindingLine = 0;
|
|
185
|
+
let bindingColumn = 0;
|
|
186
|
+
do {
|
|
187
|
+
const semi = reader.indexOf(";");
|
|
188
|
+
let genColumn = 0;
|
|
189
|
+
for (; reader.pos < semi; reader.pos++) {
|
|
190
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
191
|
+
if (!hasMoreVlq(reader, semi)) {
|
|
192
|
+
const last = stack.pop();
|
|
193
|
+
last[2] = genLine;
|
|
194
|
+
last[3] = genColumn;
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
const fields = decodeInteger(reader, 0);
|
|
198
|
+
const hasDefinition = fields & 1;
|
|
199
|
+
const hasCallsite = fields & 2;
|
|
200
|
+
const hasScope = fields & 4;
|
|
201
|
+
let callsite = null;
|
|
202
|
+
let bindings = EMPTY;
|
|
203
|
+
let range;
|
|
204
|
+
if (hasDefinition) {
|
|
205
|
+
const defSourcesIndex = decodeInteger(reader, definitionSourcesIndex);
|
|
206
|
+
definitionScopeIndex = decodeInteger(reader, definitionSourcesIndex === defSourcesIndex ? definitionScopeIndex : 0);
|
|
207
|
+
definitionSourcesIndex = defSourcesIndex;
|
|
208
|
+
range = [genLine, genColumn, 0, 0, defSourcesIndex, definitionScopeIndex];
|
|
209
|
+
} else {
|
|
210
|
+
range = [genLine, genColumn, 0, 0];
|
|
211
|
+
}
|
|
212
|
+
range.isScope = !!hasScope;
|
|
213
|
+
if (hasCallsite) {
|
|
214
|
+
const prevCsi = callsiteSourcesIndex;
|
|
215
|
+
const prevLine = callsiteLine;
|
|
216
|
+
callsiteSourcesIndex = decodeInteger(reader, callsiteSourcesIndex);
|
|
217
|
+
const sameSource = prevCsi === callsiteSourcesIndex;
|
|
218
|
+
callsiteLine = decodeInteger(reader, sameSource ? callsiteLine : 0);
|
|
219
|
+
callsiteColumn = decodeInteger(reader, sameSource && prevLine === callsiteLine ? callsiteColumn : 0);
|
|
220
|
+
callsite = [callsiteSourcesIndex, callsiteLine, callsiteColumn];
|
|
221
|
+
}
|
|
222
|
+
range.callsite = callsite;
|
|
223
|
+
if (hasMoreVlq(reader, semi)) {
|
|
224
|
+
bindings = [];
|
|
225
|
+
do {
|
|
226
|
+
bindingLine = genLine;
|
|
227
|
+
bindingColumn = genColumn;
|
|
228
|
+
const expressionsCount = decodeInteger(reader, 0);
|
|
229
|
+
let expressionRanges;
|
|
230
|
+
if (expressionsCount < -1) {
|
|
231
|
+
expressionRanges = [[decodeInteger(reader, 0)]];
|
|
232
|
+
for (let i = -1; i > expressionsCount; i--) {
|
|
233
|
+
const prevBl = bindingLine;
|
|
234
|
+
bindingLine = decodeInteger(reader, bindingLine);
|
|
235
|
+
bindingColumn = decodeInteger(reader, bindingLine === prevBl ? bindingColumn : 0);
|
|
236
|
+
const expression = decodeInteger(reader, 0);
|
|
237
|
+
expressionRanges.push([expression, bindingLine, bindingColumn]);
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
expressionRanges = [[expressionsCount]];
|
|
241
|
+
}
|
|
242
|
+
bindings.push(expressionRanges);
|
|
243
|
+
} while (hasMoreVlq(reader, semi));
|
|
244
|
+
}
|
|
245
|
+
range.bindings = bindings;
|
|
246
|
+
ranges.push(range);
|
|
247
|
+
stack.push(range);
|
|
248
|
+
}
|
|
249
|
+
genLine++;
|
|
250
|
+
reader.pos = semi + 1;
|
|
251
|
+
} while (reader.pos < length);
|
|
252
|
+
return ranges;
|
|
253
|
+
}
|
|
254
|
+
function encodeGeneratedRanges(ranges) {
|
|
255
|
+
if (ranges.length === 0)
|
|
256
|
+
return "";
|
|
257
|
+
const writer = new StringWriter();
|
|
258
|
+
for (let i = 0; i < ranges.length; ) {
|
|
259
|
+
i = _encodeGeneratedRanges(ranges, i, writer, [0, 0, 0, 0, 0, 0, 0]);
|
|
260
|
+
}
|
|
261
|
+
return writer.flush();
|
|
262
|
+
}
|
|
263
|
+
function _encodeGeneratedRanges(ranges, index, writer, state) {
|
|
264
|
+
const range = ranges[index];
|
|
265
|
+
const { 0: startLine, 1: startColumn, 2: endLine, 3: endColumn, isScope, callsite, bindings } = range;
|
|
266
|
+
if (state[0] < startLine) {
|
|
267
|
+
catchupLine(writer, state[0], startLine);
|
|
268
|
+
state[0] = startLine;
|
|
269
|
+
state[1] = 0;
|
|
270
|
+
} else if (index > 0) {
|
|
271
|
+
writer.write(comma);
|
|
272
|
+
}
|
|
273
|
+
state[1] = encodeInteger(writer, range[1], state[1]);
|
|
274
|
+
const fields = (range.length === 6 ? 1 : 0) | (callsite ? 2 : 0) | (isScope ? 4 : 0);
|
|
275
|
+
encodeInteger(writer, fields, 0);
|
|
276
|
+
if (range.length === 6) {
|
|
277
|
+
const { 4: sourcesIndex, 5: scopesIndex } = range;
|
|
278
|
+
if (sourcesIndex !== state[2]) {
|
|
279
|
+
state[3] = 0;
|
|
280
|
+
}
|
|
281
|
+
state[2] = encodeInteger(writer, sourcesIndex, state[2]);
|
|
282
|
+
state[3] = encodeInteger(writer, scopesIndex, state[3]);
|
|
283
|
+
}
|
|
284
|
+
if (callsite) {
|
|
285
|
+
const { 0: sourcesIndex, 1: callLine, 2: callColumn } = range.callsite;
|
|
286
|
+
if (sourcesIndex !== state[4]) {
|
|
287
|
+
state[5] = 0;
|
|
288
|
+
state[6] = 0;
|
|
289
|
+
} else if (callLine !== state[5]) {
|
|
290
|
+
state[6] = 0;
|
|
291
|
+
}
|
|
292
|
+
state[4] = encodeInteger(writer, sourcesIndex, state[4]);
|
|
293
|
+
state[5] = encodeInteger(writer, callLine, state[5]);
|
|
294
|
+
state[6] = encodeInteger(writer, callColumn, state[6]);
|
|
295
|
+
}
|
|
296
|
+
if (bindings) {
|
|
297
|
+
for (const binding of bindings) {
|
|
298
|
+
if (binding.length > 1)
|
|
299
|
+
encodeInteger(writer, -binding.length, 0);
|
|
300
|
+
const expression = binding[0][0];
|
|
301
|
+
encodeInteger(writer, expression, 0);
|
|
302
|
+
let bindingStartLine = startLine;
|
|
303
|
+
let bindingStartColumn = startColumn;
|
|
304
|
+
for (let i = 1; i < binding.length; i++) {
|
|
305
|
+
const expRange = binding[i];
|
|
306
|
+
bindingStartLine = encodeInteger(writer, expRange[1], bindingStartLine);
|
|
307
|
+
bindingStartColumn = encodeInteger(writer, expRange[2], bindingStartColumn);
|
|
308
|
+
encodeInteger(writer, expRange[0], 0);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
for (index++; index < ranges.length; ) {
|
|
313
|
+
const next = ranges[index];
|
|
314
|
+
const { 0: l, 1: c } = next;
|
|
315
|
+
if (l > endLine || l === endLine && c >= endColumn) {
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
index = _encodeGeneratedRanges(ranges, index, writer, state);
|
|
319
|
+
}
|
|
320
|
+
if (state[0] < endLine) {
|
|
321
|
+
catchupLine(writer, state[0], endLine);
|
|
322
|
+
state[0] = endLine;
|
|
323
|
+
state[1] = 0;
|
|
324
|
+
} else {
|
|
325
|
+
writer.write(comma);
|
|
326
|
+
}
|
|
327
|
+
state[1] = encodeInteger(writer, endColumn, state[1]);
|
|
328
|
+
return index;
|
|
329
|
+
}
|
|
330
|
+
function catchupLine(writer, lastLine, line) {
|
|
331
|
+
do {
|
|
332
|
+
writer.write(semicolon);
|
|
333
|
+
} while (++lastLine < line);
|
|
334
|
+
}
|
|
335
|
+
function decode(mappings) {
|
|
336
|
+
const { length } = mappings;
|
|
337
|
+
const reader = new StringReader(mappings);
|
|
338
|
+
const decoded = [];
|
|
339
|
+
let genColumn = 0;
|
|
340
|
+
let sourcesIndex = 0;
|
|
341
|
+
let sourceLine = 0;
|
|
342
|
+
let sourceColumn = 0;
|
|
343
|
+
let namesIndex = 0;
|
|
344
|
+
do {
|
|
345
|
+
const semi = reader.indexOf(";");
|
|
346
|
+
const line = [];
|
|
347
|
+
let sorted = true;
|
|
348
|
+
let lastCol = 0;
|
|
349
|
+
genColumn = 0;
|
|
350
|
+
while (reader.pos < semi) {
|
|
351
|
+
let seg;
|
|
352
|
+
genColumn = decodeInteger(reader, genColumn);
|
|
353
|
+
if (genColumn < lastCol)
|
|
354
|
+
sorted = false;
|
|
355
|
+
lastCol = genColumn;
|
|
356
|
+
if (hasMoreVlq(reader, semi)) {
|
|
357
|
+
sourcesIndex = decodeInteger(reader, sourcesIndex);
|
|
358
|
+
sourceLine = decodeInteger(reader, sourceLine);
|
|
359
|
+
sourceColumn = decodeInteger(reader, sourceColumn);
|
|
360
|
+
if (hasMoreVlq(reader, semi)) {
|
|
361
|
+
namesIndex = decodeInteger(reader, namesIndex);
|
|
362
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex];
|
|
363
|
+
} else {
|
|
364
|
+
seg = [genColumn, sourcesIndex, sourceLine, sourceColumn];
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
seg = [genColumn];
|
|
368
|
+
}
|
|
369
|
+
line.push(seg);
|
|
370
|
+
reader.pos++;
|
|
371
|
+
}
|
|
372
|
+
if (!sorted)
|
|
373
|
+
sort(line);
|
|
374
|
+
decoded.push(line);
|
|
375
|
+
reader.pos = semi + 1;
|
|
376
|
+
} while (reader.pos <= length);
|
|
377
|
+
return decoded;
|
|
378
|
+
}
|
|
379
|
+
function sort(line) {
|
|
380
|
+
line.sort(sortComparator);
|
|
381
|
+
}
|
|
382
|
+
function sortComparator(a, b) {
|
|
383
|
+
return a[0] - b[0];
|
|
384
|
+
}
|
|
385
|
+
function encode(decoded) {
|
|
386
|
+
const writer = new StringWriter();
|
|
387
|
+
let sourcesIndex = 0;
|
|
388
|
+
let sourceLine = 0;
|
|
389
|
+
let sourceColumn = 0;
|
|
390
|
+
let namesIndex = 0;
|
|
391
|
+
for (let i = 0; i < decoded.length; i++) {
|
|
392
|
+
const line = decoded[i];
|
|
393
|
+
if (i > 0)
|
|
394
|
+
writer.write(semicolon);
|
|
395
|
+
if (line.length === 0)
|
|
396
|
+
continue;
|
|
397
|
+
let genColumn = 0;
|
|
398
|
+
for (let j = 0; j < line.length; j++) {
|
|
399
|
+
const segment = line[j];
|
|
400
|
+
if (j > 0)
|
|
401
|
+
writer.write(comma);
|
|
402
|
+
genColumn = encodeInteger(writer, segment[0], genColumn);
|
|
403
|
+
if (segment.length === 1)
|
|
404
|
+
continue;
|
|
405
|
+
sourcesIndex = encodeInteger(writer, segment[1], sourcesIndex);
|
|
406
|
+
sourceLine = encodeInteger(writer, segment[2], sourceLine);
|
|
407
|
+
sourceColumn = encodeInteger(writer, segment[3], sourceColumn);
|
|
408
|
+
if (segment.length === 4)
|
|
409
|
+
continue;
|
|
410
|
+
namesIndex = encodeInteger(writer, segment[4], namesIndex);
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
return writer.flush();
|
|
414
|
+
}
|
|
415
|
+
exports3.decode = decode;
|
|
416
|
+
exports3.decodeGeneratedRanges = decodeGeneratedRanges;
|
|
417
|
+
exports3.decodeOriginalScopes = decodeOriginalScopes;
|
|
418
|
+
exports3.encode = encode;
|
|
419
|
+
exports3.encodeGeneratedRanges = encodeGeneratedRanges;
|
|
420
|
+
exports3.encodeOriginalScopes = encodeOriginalScopes;
|
|
421
|
+
Object.defineProperty(exports3, "__esModule", { value: true });
|
|
422
|
+
});
|
|
423
|
+
})(sourcemapCodec_umd.__module, sourcemapCodec_umd.__module.exports);
|
|
424
|
+
var sourcemapCodec_umdExports = sourcemapCodec_umd.__module.exports;
|
|
425
|
+
exports.sourcemapCodec_umdExports = sourcemapCodec_umdExports;
|