1 | var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
2 | if (kind === "m") throw new TypeError("Private method is not writable");
|
3 | if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
4 | if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
5 | return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
6 | };
|
7 | var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
8 | if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
9 | if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
10 | return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
11 | };
|
12 | var _JSTextEncoderStream_t, _JSTextDecoderStream_t;
|
13 | if (!('TextEncoderStream' in self)) {
|
14 | class TES {
|
15 | constructor() {
|
16 | Object.defineProperty(this, "encoder", {
|
17 | enumerable: true,
|
18 | configurable: true,
|
19 | writable: true,
|
20 | value: void 0
|
21 | });
|
22 | }
|
23 | start() { this.encoder = new TextEncoder(); }
|
24 | transform(chunk, controller) {
|
25 | controller.enqueue(this.encoder.encode(chunk));
|
26 | }
|
27 | }
|
28 | class JSTextEncoderStream extends TransformStream {
|
29 | constructor() {
|
30 | const t = new TES();
|
31 | super(t);
|
32 | _JSTextEncoderStream_t.set(this, void 0);
|
33 | __classPrivateFieldSet(this, _JSTextEncoderStream_t, t, "f");
|
34 | }
|
35 | get encoding() { return __classPrivateFieldGet(this, _JSTextEncoderStream_t, "f").encoder.encoding; }
|
36 | }
|
37 | _JSTextEncoderStream_t = new WeakMap();
|
38 | Object.defineProperty(self, 'TextEncoderStream', {
|
39 | configurable: false,
|
40 | enumerable: false,
|
41 | writable: false,
|
42 | value: JSTextEncoderStream,
|
43 | });
|
44 | }
|
45 | if (!('TextDecoderStream' in self)) {
|
46 | class TDS {
|
47 | constructor(encoding, options) {
|
48 | Object.defineProperty(this, "decoder", {
|
49 | enumerable: true,
|
50 | configurable: true,
|
51 | writable: true,
|
52 | value: void 0
|
53 | });
|
54 | Object.defineProperty(this, "encoding", {
|
55 | enumerable: true,
|
56 | configurable: true,
|
57 | writable: true,
|
58 | value: void 0
|
59 | });
|
60 | Object.defineProperty(this, "options", {
|
61 | enumerable: true,
|
62 | configurable: true,
|
63 | writable: true,
|
64 | value: void 0
|
65 | });
|
66 | this.encoding = encoding;
|
67 | this.options = options;
|
68 | }
|
69 | start() { this.decoder = new TextDecoder(this.encoding, this.options); }
|
70 | transform(chunk, controller) {
|
71 | controller.enqueue(this.decoder.decode(chunk, { stream: true }));
|
72 | }
|
73 | }
|
74 | class JSTextDecoderStream extends TransformStream {
|
75 | constructor(encoding = 'utf-8', { ...options } = {}) {
|
76 | const t = new TDS(encoding, options);
|
77 | super(t);
|
78 | _JSTextDecoderStream_t.set(this, void 0);
|
79 | __classPrivateFieldSet(this, _JSTextDecoderStream_t, t, "f");
|
80 | }
|
81 | get encoding() { return __classPrivateFieldGet(this, _JSTextDecoderStream_t, "f").decoder.encoding; }
|
82 | get fatal() { return __classPrivateFieldGet(this, _JSTextDecoderStream_t, "f").decoder.fatal; }
|
83 | get ignoreBOM() { return __classPrivateFieldGet(this, _JSTextDecoderStream_t, "f").decoder.ignoreBOM; }
|
84 | }
|
85 | _JSTextDecoderStream_t = new WeakMap();
|
86 | Object.defineProperty(self, 'TextDecoderStream', {
|
87 | configurable: false,
|
88 | enumerable: false,
|
89 | writable: false,
|
90 | value: JSTextDecoderStream,
|
91 | });
|
92 | }
|
93 | export {};
|
94 |
|
\ | No newline at end of file |