expo 58.0.1 → 58.0.3

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 (33) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/winter/runtime.native.js +0 -2
  3. package/build/winter/runtime.native.js.map +1 -1
  4. package/bundledNativeModules.json +77 -77
  5. package/ios/Expo/ExpoReactNativeFactory.swift +2 -2
  6. package/ios/ExpoObjC/AppDelegates/EXReactRootViewFactory.mm +16 -2
  7. package/ios/ExpoObjC/include/Expo/EXReactRootViewFactory.h +2 -1
  8. package/package.json +17 -18
  9. package/scripts/spm/__tests__/app-target.test.js +105 -1
  10. package/scripts/spm/__tests__/autolink-gate.test.js +188 -0
  11. package/scripts/spm/__tests__/classify.test.js +17 -19
  12. package/scripts/spm/__tests__/diagnostics.test.js +705 -132
  13. package/scripts/spm/__tests__/manifests.test.js +1086 -75
  14. package/scripts/spm/__tests__/metadata.test.js +120 -0
  15. package/scripts/spm/__tests__/plugin.test.js +2549 -346
  16. package/scripts/spm/app-target.js +44 -1
  17. package/scripts/spm/autolink-gate.js +40 -0
  18. package/scripts/spm/classify.js +54 -77
  19. package/scripts/spm/diagnostics.js +540 -147
  20. package/scripts/spm/flavored-frameworks.js +80 -125
  21. package/scripts/spm/manifests.js +523 -205
  22. package/scripts/spm/metadata.js +152 -0
  23. package/scripts/spm/plugin.js +592 -277
  24. package/scripts/spm/podspec.js +56 -19
  25. package/src/async-require/__tests__/loadBundle.test.ios.ts +2 -2
  26. package/src/winter/__tests__/{TextDecoderStream.test.ios.ts → TextDecoderStream.test.native.ts} +23 -2
  27. package/src/winter/runtime.native.ts +0 -2
  28. package/template.tgz +0 -0
  29. package/build/winter/TextDecoder.d.ts +0 -13
  30. package/build/winter/TextDecoder.js +0 -357
  31. package/build/winter/TextDecoder.js.map +0 -1
  32. package/src/winter/TextDecoder.ts +0 -427
  33. package/src/winter/__tests__/TextDecoder.test.native.ts +0 -549
@@ -11,8 +11,9 @@
11
11
  const fs = require('fs');
12
12
  const path = require('path');
13
13
 
14
- // No reader below is sensitive to a trailing `\r` today; the normalisation is here so
15
- // that one anchoring a pattern at line end does not quietly fail on a CRLF checkout.
14
+ const { APPLE_SOURCE_DIRS } = require('./classify');
15
+
16
+ // CRLF-safe.
16
17
  const sourceLines = (text) => text.replace(/\r\n/g, '\n').split('\n');
17
18
 
18
19
  // ---------------------------------------------------------------------------
@@ -121,10 +122,40 @@ function xcconfigLinkerFlags(text) {
121
122
  return null;
122
123
  }
123
124
 
125
+ /** Pod names a podspec depends on, ignoring `test_spec` blocks. Text-only. */
126
+ function podspecDependencies(text) {
127
+ const deps = [];
128
+ for (const { text: line } of podspecBodyLines(text)) {
129
+ const match = line.match(/\.dependency\s+['"]([^'"]+)['"]/);
130
+ if (match) deps.push(match[1]);
131
+ }
132
+ return deps;
133
+ }
134
+
124
135
  // ---------------------------------------------------------------------------
125
136
  // I/O
126
137
  // ---------------------------------------------------------------------------
127
138
 
139
+ function readText(file) {
140
+ try {
141
+ return fs.readFileSync(file, 'utf8');
142
+ } catch {
143
+ return null;
144
+ }
145
+ }
146
+
147
+ function podspecsIn(dir) {
148
+ try {
149
+ return fs
150
+ .readdirSync(dir)
151
+ .filter((name) => name.endsWith('.podspec'))
152
+ .sort()
153
+ .map((name) => path.join(dir, name));
154
+ } catch {
155
+ return [];
156
+ }
157
+ }
158
+
128
159
  /**
129
160
  * The podspecs describing `podName`: its own file when one carries its name, else
130
161
  * every podspec in the directories — a module may name its podspec anything.
@@ -134,17 +165,7 @@ function podspecFiles(podName, dirs) {
134
165
  const own = path.join(dir, `${podName}.podspec`);
135
166
  if (fs.existsSync(own)) return [own];
136
167
  }
137
- return dirs.flatMap((dir) => {
138
- try {
139
- return fs
140
- .readdirSync(dir)
141
- .filter((name) => name.endsWith('.podspec'))
142
- .sort()
143
- .map((name) => path.join(dir, name));
144
- } catch {
145
- return [];
146
- }
147
- });
168
+ return dirs.flatMap(podspecsIn);
148
169
  }
149
170
 
150
171
  /**
@@ -156,12 +177,8 @@ function podspecFiles(podName, dirs) {
156
177
  function readPodspecs(podName, dirs) {
157
178
  const texts = [];
158
179
  for (const file of podspecFiles(podName, dirs)) {
159
- let text = '';
160
- try {
161
- text = fs.readFileSync(file, 'utf8');
162
- } catch {
163
- continue;
164
- }
180
+ const text = readText(file);
181
+ if (text == null) continue;
165
182
  const declaration = linkageDeclaration(text);
166
183
  if (declaration != null) {
167
184
  return {
@@ -184,9 +201,29 @@ function readPodspecs(podName, dirs) {
184
201
  };
185
202
  }
186
203
 
204
+ /**
205
+ * Everything the plugin reads from a pod's podspecs, read once per pod. Linkage is
206
+ * looked for beside the pod and in the module's source directories and root;
207
+ * dependencies are read from every podspec in the pod's own directory, so a pod
208
+ * sharing it with siblings reports theirs too.
209
+ */
210
+ function readPodspecFacts({ podName, podspecDir, moduleRoot }) {
211
+ const dirs = [
212
+ podspecDir,
213
+ ...APPLE_SOURCE_DIRS.map((dir) => path.join(moduleRoot, dir)),
214
+ moduleRoot,
215
+ ].filter(Boolean);
216
+ const dependencies = new Set(
217
+ podspecsIn(podspecDir).flatMap((file) => podspecDependencies(readText(file) ?? ''))
218
+ );
219
+ return { ...readPodspecs(podName, dirs), dependencies: [...dependencies] };
220
+ }
221
+
187
222
  module.exports = {
188
223
  podspecBodyLines,
224
+ podspecDependencies,
189
225
  linkageDeclaration,
190
226
  xcconfigLinkerFlags,
191
227
  readPodspecs,
228
+ readPodspecFacts,
192
229
  };
@@ -42,8 +42,8 @@ it('asserts in production when attempting to load a bundle and the user-defined
42
42
  'Second.bundle?platform=ios&modulesOnly=true&runModule=false&runtimeBytecodeVersion='
43
43
  )
44
44
  ).rejects.toThrow();
45
- expect(HMRClient.registerBundle).not.toBeCalled();
46
- expect(fetchThenEvalAsync).not.toBeCalled();
45
+ expect(HMRClient.registerBundle).not.toHaveBeenCalled();
46
+ expect(fetchThenEvalAsync).not.toHaveBeenCalled();
47
47
  });
48
48
 
49
49
  it('loads a bundle in production with user-defined location.origin', async () => {
@@ -1,6 +1,5 @@
1
1
  describe('TextDecoderStream', () => {
2
2
  it(`uses the Expo built-in APIs`, () => {
3
- expect((TextDecoder as any)[Symbol.for('expo.builtin')]).toBe(true);
4
3
  expect((TextDecoderStream as any)[Symbol.for('expo.builtin')]).toBe(true);
5
4
  });
6
5
 
@@ -101,6 +100,28 @@ describe('TextDecoderStream', () => {
101
100
  });
102
101
  }
103
102
 
103
+ it.each([
104
+ [
105
+ 'latin1',
106
+ [
107
+ [0x63, 0x61],
108
+ [0x66, 0xe9],
109
+ ],
110
+ 'café',
111
+ ],
112
+ ['utf-16le', [[0x63], [0, 0x61, 0, 0x66, 0, 0xe9], [0]], 'café'],
113
+ ])('streams %s using the runtime decoder', async (encoding, chunks, expected) => {
114
+ const stream = createStreamFromChunks(chunks.map((chunk) => new Uint8Array(chunk)));
115
+ const reader = stream.pipeThrough(new TextDecoderStream(encoding)).getReader();
116
+ let text = '';
117
+ while (true) {
118
+ const { value, done } = await reader.read();
119
+ if (done) break;
120
+ text += value;
121
+ }
122
+ expect(text).toBe(expected);
123
+ });
124
+
104
125
  it('decodes simple UTF-8 text', async () => {
105
126
  const text = 'Hello, world!';
106
127
  const encoded = new TextEncoder().encode(text);
@@ -145,7 +166,7 @@ describe('TextDecoderStream', () => {
145
166
 
146
167
  const reader = stream.pipeThrough(decoder).getReader();
147
168
 
148
- await expect(reader.read()).rejects.toThrow(TypeError);
169
+ await expect(reader.read()).rejects.toThrow(expect.objectContaining({ name: 'TypeError' }));
149
170
  });
150
171
 
151
172
  it('respects ignoreBOM: true (preserves BOM)', async () => {
@@ -8,8 +8,6 @@ import '../../types';
8
8
  import { installFormDataPatch } from './FormData';
9
9
  import { installGlobal as install } from './installGlobal';
10
10
 
11
- // https://encoding.spec.whatwg.org/#textdecoder
12
- install('TextDecoder', () => require('./TextDecoder').TextDecoder);
13
11
  // https://encoding.spec.whatwg.org/#interface-textdecoderstream
14
12
  install('TextDecoderStream', () => require('./TextDecoderStream').TextDecoderStream);
15
13
  // https://encoding.spec.whatwg.org/#interface-textencoderstream
package/template.tgz CHANGED
Binary file
@@ -1,13 +0,0 @@
1
- export declare class TextDecoder {
2
- private readonly _state;
3
- constructor(label?: string, options?: {
4
- fatal?: boolean;
5
- ignoreBOM?: boolean;
6
- });
7
- get encoding(): string;
8
- get fatal(): boolean;
9
- get ignoreBOM(): boolean;
10
- decode(input?: ArrayBuffer | ArrayBufferView, options?: {
11
- stream?: boolean;
12
- }): string;
13
- }
@@ -1,357 +0,0 @@
1
- // UTF-8-only TextDecoder fallback for runtimes that do not provide one.
2
- const EMPTY_BYTES = new Uint8Array(0);
3
- function assertValidUTF8Label(label) {
4
- const normalizedLabel = String(label).trim().toLowerCase();
5
- switch(normalizedLabel){
6
- case 'unicode-1-1-utf-8':
7
- case 'unicode11utf8':
8
- case 'unicode20utf8':
9
- case 'utf-8':
10
- case 'utf8':
11
- case 'x-unicode20utf8':
12
- return;
13
- default:
14
- throw new RangeError(`Unknown encoding: ${label} (normalized: ${normalizedLabel})`);
15
- }
16
- }
17
- function normalizeBytes(input) {
18
- if (input === undefined) {
19
- return EMPTY_BYTES;
20
- } else if (input instanceof Uint8Array) {
21
- return input;
22
- } else if (ArrayBuffer.isView(input)) {
23
- return new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
24
- } else if (input[Symbol.toStringTag] === 'ArrayBuffer' || input[Symbol.toStringTag] === 'SharedArrayBuffer') {
25
- return new Uint8Array(input);
26
- } else {
27
- throw new TypeError('The input must be an ArrayBuffer or ArrayBufferView');
28
- }
29
- }
30
- function decoderError(state) {
31
- if (state.fatal) {
32
- throw new TypeError('Decoder error');
33
- }
34
- return '\ufffd';
35
- }
36
- function appendASCII(output, bytes, start, end) {
37
- // NOTE(@kitten): For longer strings, direct `apply` + `subarray` conversion w/o byte-for-byte copy or spreads is
38
- // the most efficient by far (3x), leaning on native conversion below the variadic limit
39
- const HERMES_VARIADIC_ARGUMENT_LIMIT = 4096;
40
- while(start < end){
41
- output += String.fromCharCode.apply(null, bytes.subarray(start, Math.min(start + HERMES_VARIADIC_ARGUMENT_LIMIT, end)));
42
- start += HERMES_VARIADIC_ARGUMENT_LIMIT;
43
- }
44
- return output;
45
- }
46
- function fallback(output, index) {
47
- return {
48
- output,
49
- index
50
- };
51
- }
52
- function decodeUTF8Fast(bytes, start) {
53
- let output = '';
54
- let i = start;
55
- const length = bytes.length;
56
- while(i < length){
57
- const b0 = bytes[i];
58
- if (b0 < 0x80) {
59
- // NOTE(@kitten): For ASCII text, it's fastest to process the first 32 chars directly
60
- // After, `appendASCII`'s variadic apply wins out
61
- const directEnd = Math.min(i + 32, length);
62
- do {
63
- output += String.fromCharCode(bytes[i++]);
64
- }while (i < directEnd && bytes[i] < 0x80)
65
- if (i === directEnd && i < length && bytes[i] < 0x80) {
66
- const asciiStart = i;
67
- do {
68
- i++;
69
- }while (i < length && bytes[i] < 0x80)
70
- output = appendASCII(output, bytes, asciiStart, i);
71
- }
72
- } else if (b0 >= 0xc2 && b0 <= 0xdf) {
73
- if (i + 1 >= length) return fallback(output, i);
74
- const b1 = bytes[i + 1];
75
- if ((b1 & 0xc0) !== 0x80) return fallback(output, i);
76
- output += String.fromCharCode((b0 & 0x1f) << 6 | b1 & 0x3f);
77
- i += 2;
78
- } else if (b0 >= 0xe0 && b0 <= 0xef) {
79
- if (i + 2 >= length) return fallback(output, i);
80
- const b1 = bytes[i + 1];
81
- const b2 = bytes[i + 2];
82
- if (b1 < (b0 === 0xe0 ? 0xa0 : 0x80) || b1 > (b0 === 0xed ? 0x9f : 0xbf) || (b2 & 0xc0) !== 0x80) {
83
- return fallback(output, i);
84
- }
85
- output += String.fromCharCode((b0 & 0x0f) << 12 | (b1 & 0x3f) << 6 | b2 & 0x3f);
86
- i += 3;
87
- } else if (b0 >= 0xf0 && b0 <= 0xf4) {
88
- if (i + 3 >= length) return fallback(output, i);
89
- const b1 = bytes[i + 1];
90
- const b2 = bytes[i + 2];
91
- const b3 = bytes[i + 3];
92
- if (b1 < (b0 === 0xf0 ? 0x90 : 0x80) || b1 > (b0 === 0xf4 ? 0x8f : 0xbf) || (b2 & 0xc0) !== 0x80 || (b3 & 0xc0) !== 0x80) {
93
- return fallback(output, i);
94
- }
95
- const codePoint = ((b0 & 0x07) << 18 | (b1 & 0x3f) << 12 | (b2 & 0x3f) << 6 | b3 & 0x3f) - 0x10000;
96
- output += String.fromCharCode((codePoint >> 10) + 0xd800, (codePoint & 0x3ff) + 0xdc00);
97
- i += 4;
98
- } else {
99
- return fallback(output, i);
100
- }
101
- }
102
- return output;
103
- }
104
- function decodeUTF8General(bytes, state, stream, output = '', start = 0) {
105
- const { ignoreBOM } = state;
106
- let { pending, bomSeen } = state;
107
- let i = start;
108
- const length = bytes.length;
109
- if (pending.length > 0) {
110
- const b0 = pending[0];
111
- const bytesNeeded = b0 <= 0xdf ? 1 : b0 <= 0xef ? 2 : 3;
112
- let codePoint = b0 & (bytesNeeded === 1 ? 0x1f : bytesNeeded === 2 ? 0x0f : 0x07);
113
- let bytesSeen = 0;
114
- for(let p = 1; p < pending.length; p++){
115
- codePoint = codePoint << 6 | pending[p] & 0x3f;
116
- bytesSeen++;
117
- }
118
- while(bytesSeen < bytesNeeded && i < length){
119
- const byte = bytes[i];
120
- if ((byte & 0xc0) !== 0x80 || bytesSeen === 0 && (b0 === 0xe0 && byte < 0xa0 || b0 === 0xed && byte > 0x9f || b0 === 0xf0 && byte < 0x90 || b0 === 0xf4 && byte > 0x8f)) {
121
- pending = EMPTY_BYTES;
122
- output += decoderError(state);
123
- bomSeen = true;
124
- break;
125
- }
126
- codePoint = codePoint << 6 | byte & 0x3f;
127
- bytesSeen++;
128
- i++;
129
- }
130
- if (bytesSeen === bytesNeeded) {
131
- pending = EMPTY_BYTES;
132
- if (bomSeen || ignoreBOM || codePoint !== 0xfeff) {
133
- if (codePoint <= 0xffff) {
134
- output += String.fromCharCode(codePoint);
135
- } else {
136
- codePoint -= 0x10000;
137
- output += String.fromCharCode((codePoint >> 10) + 0xd800, (codePoint & 0x3ff) + 0xdc00);
138
- }
139
- }
140
- bomSeen = true;
141
- } else if (i === length) {
142
- if (stream && i > 0) {
143
- const nextPending = new Uint8Array(pending.length + i);
144
- nextPending.set(pending);
145
- nextPending.set(bytes.subarray(0, i), pending.length);
146
- pending = nextPending;
147
- } else if (!stream) {
148
- pending = EMPTY_BYTES;
149
- output += decoderError(state);
150
- bomSeen = true;
151
- }
152
- }
153
- if (pending.length > 0) {
154
- state.pending = pending;
155
- state.bomSeen = bomSeen;
156
- return output;
157
- }
158
- }
159
- while(i < length){
160
- const b0 = bytes[i];
161
- if (b0 < 0x80) {
162
- bomSeen = true;
163
- const directEnd = Math.min(i + 32, length);
164
- do {
165
- output += String.fromCharCode(bytes[i++]);
166
- }while (i < directEnd && bytes[i] < 0x80)
167
- if (i === directEnd && i < length && bytes[i] < 0x80) {
168
- const asciiStart = i;
169
- do {
170
- i++;
171
- }while (i < length && bytes[i] < 0x80)
172
- output = appendASCII(output, bytes, asciiStart, i);
173
- }
174
- continue;
175
- }
176
- let codePoint;
177
- const remaining = length - i;
178
- if (b0 >= 0xc2 && b0 <= 0xdf) {
179
- if (remaining < 2) {
180
- if (stream) {
181
- pending = bytes.slice(i);
182
- } else {
183
- output += decoderError(state);
184
- }
185
- break;
186
- }
187
- const b1 = bytes[i + 1];
188
- if ((b1 & 0xc0) !== 0x80) {
189
- output += decoderError(state);
190
- bomSeen = true;
191
- i++;
192
- continue;
193
- }
194
- codePoint = (b0 & 0x1f) << 6 | b1 & 0x3f;
195
- i += 2;
196
- } else if (b0 >= 0xe0 && b0 <= 0xef) {
197
- if (remaining < 2) {
198
- if (stream) {
199
- pending = bytes.slice(i);
200
- } else {
201
- output += decoderError(state);
202
- }
203
- break;
204
- }
205
- const b1 = bytes[i + 1];
206
- if ((b1 & 0xc0) !== 0x80 || b0 === 0xe0 && b1 < 0xa0 || b0 === 0xed && b1 > 0x9f) {
207
- output += decoderError(state);
208
- bomSeen = true;
209
- i++;
210
- continue;
211
- } else if (remaining < 3) {
212
- if (stream) {
213
- pending = bytes.slice(i);
214
- } else {
215
- output += decoderError(state);
216
- }
217
- break;
218
- }
219
- const b2 = bytes[i + 2];
220
- if ((b2 & 0xc0) !== 0x80) {
221
- output += decoderError(state);
222
- bomSeen = true;
223
- i += 2;
224
- continue;
225
- }
226
- codePoint = (b0 & 0x0f) << 12 | (b1 & 0x3f) << 6 | b2 & 0x3f;
227
- i += 3;
228
- } else if (b0 >= 0xf0 && b0 <= 0xf4) {
229
- if (remaining < 2) {
230
- if (stream) {
231
- pending = bytes.slice(i);
232
- } else {
233
- output += decoderError(state);
234
- }
235
- break;
236
- }
237
- const b1 = bytes[i + 1];
238
- if ((b1 & 0xc0) !== 0x80 || b0 === 0xf0 && b1 < 0x90 || b0 === 0xf4 && b1 > 0x8f) {
239
- output += decoderError(state);
240
- bomSeen = true;
241
- i++;
242
- continue;
243
- } else if (remaining < 3) {
244
- if (stream) {
245
- pending = bytes.slice(i);
246
- } else {
247
- output += decoderError(state);
248
- }
249
- break;
250
- }
251
- const b2 = bytes[i + 2];
252
- if ((b2 & 0xc0) !== 0x80) {
253
- output += decoderError(state);
254
- bomSeen = true;
255
- i += 2;
256
- continue;
257
- } else if (remaining < 4) {
258
- if (stream) {
259
- pending = bytes.slice(i);
260
- } else {
261
- output += decoderError(state);
262
- }
263
- break;
264
- }
265
- const b3 = bytes[i + 3];
266
- if ((b3 & 0xc0) !== 0x80) {
267
- output += decoderError(state);
268
- bomSeen = true;
269
- i += 3;
270
- continue;
271
- }
272
- codePoint = (b0 & 0x07) << 18 | (b1 & 0x3f) << 12 | (b2 & 0x3f) << 6 | b3 & 0x3f;
273
- i += 4;
274
- } else {
275
- output += decoderError(state);
276
- bomSeen = true;
277
- i++;
278
- continue;
279
- }
280
- if (bomSeen || ignoreBOM || codePoint !== 0xfeff) {
281
- if (codePoint <= 0xffff) {
282
- output += String.fromCharCode(codePoint);
283
- } else {
284
- codePoint -= 0x10000;
285
- output += String.fromCharCode((codePoint >> 10) + 0xd800, (codePoint & 0x3ff) + 0xdc00);
286
- }
287
- }
288
- bomSeen = true;
289
- }
290
- state.pending = pending;
291
- state.bomSeen = bomSeen;
292
- return output;
293
- }
294
- function decodeUTF8(bytes, state, stream) {
295
- if (state.pending.length === 0) {
296
- if (!stream && !state.bomSeen) {
297
- const skipBOM = !state.ignoreBOM && bytes[0] === 0xef && bytes[1] === 0xbb && bytes[2] === 0xbf ? 3 : 0;
298
- const result = decodeUTF8Fast(bytes, skipBOM);
299
- if (typeof result === 'string') {
300
- state.bomSeen = bytes.length > 0;
301
- return result;
302
- }
303
- state.bomSeen = skipBOM > 0 || result.index > skipBOM;
304
- return decodeUTF8General(bytes, state, false, result.output, result.index);
305
- }
306
- }
307
- return decodeUTF8General(bytes, state, stream);
308
- }
309
- // @docsMissing
310
- export class TextDecoder {
311
- _state;
312
- constructor(label = 'utf-8', options = {}){
313
- if (options == null || typeof options !== 'object' && typeof options !== 'function') {
314
- throw new TypeError('Second argument of TextDecoder must be undefined or an object, e.g. { fatal: true }');
315
- }
316
- assertValidUTF8Label(label);
317
- this._state = {
318
- fatal: Boolean(options.fatal),
319
- ignoreBOM: Boolean(options.ignoreBOM),
320
- bomSeen: false,
321
- pending: EMPTY_BYTES,
322
- streaming: false
323
- };
324
- }
325
- get encoding() {
326
- return 'utf-8';
327
- }
328
- get fatal() {
329
- return this._state.fatal;
330
- }
331
- get ignoreBOM() {
332
- return this._state.ignoreBOM;
333
- }
334
- decode(input, options = {}) {
335
- if (options == null || typeof options !== 'object' && typeof options !== 'function') {
336
- throw new TypeError('The options argument must be undefined or an object');
337
- }
338
- const bytes = normalizeBytes(input);
339
- const stream = Boolean(options.stream);
340
- const state = this._state;
341
- if (!state.streaming) {
342
- state.bomSeen = false;
343
- state.pending = EMPTY_BYTES;
344
- }
345
- try {
346
- const output = decodeUTF8(bytes, state, stream);
347
- state.streaming = stream;
348
- return output;
349
- } catch (error) {
350
- state.pending = EMPTY_BYTES;
351
- state.streaming = false;
352
- throw error;
353
- }
354
- }
355
- }
356
-
357
- //# sourceMappingURL=TextDecoder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["winter/TextDecoder.ts"],"sourcesContent":[null],"names":["EMPTY_BYTES","Uint8Array","assertValidUTF8Label","label","normalizedLabel","String","trim","toLowerCase","RangeError","normalizeBytes","input","undefined","ArrayBuffer","isView","buffer","byteOffset","byteLength","Symbol","toStringTag","TypeError","decoderError","state","fatal","appendASCII","output","bytes","start","end","HERMES_VARIADIC_ARGUMENT_LIMIT","fromCharCode","apply","subarray","Math","min","fallback","index","decodeUTF8Fast","i","length","b0","directEnd","asciiStart","b1","b2","b3","codePoint","decodeUTF8General","stream","ignoreBOM","pending","bomSeen","bytesNeeded","bytesSeen","p","byte","nextPending","set","remaining","slice","decodeUTF8","skipBOM","result","TextDecoder","_state","options","Boolean","streaming","encoding","decode","error"],"mappings":"AAAA,wEAAwE;AAExE,MAAMA,cAAc,IAAIC,WAAW;AAUnC,SAASC,qBAAqBC,KAAc;IAC1C,MAAMC,kBAAkBC,OAAOF,OAAOG,IAAI,GAAGC,WAAW;IACxD,OAAQH;QACN,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;QACL,KAAK;YACH;QACF;YACE,MAAM,IAAII,WAAW,CAAC,kBAAkB,EAAEL,MAAM,cAAc,EAAEC,gBAAgB,CAAC,CAAC;IACtF;AACF;AAEA,SAASK,eAAeC,KAAgD;IACtE,IAAIA,UAAUC,WAAW;QACvB,OAAOX;IACT,OAAO,IAAIU,iBAAiBT,YAAY;QACtC,OAAOS;IACT,OAAO,IAAIE,YAAYC,MAAM,CAACH,QAAQ;QACpC,OAAO,IAAIT,WAAWS,MAAMI,MAAM,EAAEJ,MAAMK,UAAU,EAAEL,MAAMM,UAAU;IACxE,OAAO,IACL,AAACN,KAAK,CAACO,OAAOC,WAAW,CAAC,KAAgB,iBAC1C,AAACR,KAAK,CAACO,OAAOC,WAAW,CA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