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