@yume-chan/stream-extra 0.0.0-20240714132542
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/CHANGELOG.md +76 -0
- package/LICENSE +21 -0
- package/README.md +43 -0
- package/esm/buffered-transform.d.ts +11 -0
- package/esm/buffered-transform.d.ts.map +1 -0
- package/esm/buffered-transform.js +57 -0
- package/esm/buffered-transform.js.map +1 -0
- package/esm/buffered.d.ts +23 -0
- package/esm/buffered.d.ts.map +1 -0
- package/esm/buffered.js +138 -0
- package/esm/buffered.js.map +1 -0
- package/esm/concat.d.ts +36 -0
- package/esm/concat.d.ts.map +1 -0
- package/esm/concat.js +130 -0
- package/esm/concat.js.map +1 -0
- package/esm/consumable.d.ts +40 -0
- package/esm/consumable.d.ts.map +1 -0
- package/esm/consumable.js +130 -0
- package/esm/consumable.js.map +1 -0
- package/esm/distribution.d.ts +22 -0
- package/esm/distribution.d.ts.map +1 -0
- package/esm/distribution.js +103 -0
- package/esm/distribution.js.map +1 -0
- package/esm/duplex.d.ts +45 -0
- package/esm/duplex.d.ts.map +1 -0
- package/esm/duplex.js +93 -0
- package/esm/duplex.js.map +1 -0
- package/esm/encoding.d.ts +21 -0
- package/esm/encoding.d.ts.map +1 -0
- package/esm/encoding.js +4 -0
- package/esm/encoding.js.map +1 -0
- package/esm/index.d.ts +19 -0
- package/esm/index.d.ts.map +1 -0
- package/esm/index.js +19 -0
- package/esm/index.js.map +1 -0
- package/esm/inspect.d.ts +5 -0
- package/esm/inspect.d.ts.map +1 -0
- package/esm/inspect.js +12 -0
- package/esm/inspect.js.map +1 -0
- package/esm/maybe-consumable.d.ts +21 -0
- package/esm/maybe-consumable.d.ts.map +1 -0
- package/esm/maybe-consumable.js +62 -0
- package/esm/maybe-consumable.js.map +1 -0
- package/esm/pipe-from.d.ts +13 -0
- package/esm/pipe-from.d.ts.map +1 -0
- package/esm/pipe-from.js +24 -0
- package/esm/pipe-from.js.map +1 -0
- package/esm/push-readable.d.ts +35 -0
- package/esm/push-readable.d.ts.map +1 -0
- package/esm/push-readable.js +240 -0
- package/esm/push-readable.js.map +1 -0
- package/esm/split-string.d.ts +5 -0
- package/esm/split-string.d.ts.map +1 -0
- package/esm/split-string.js +25 -0
- package/esm/split-string.js.map +1 -0
- package/esm/stream.d.ts +25 -0
- package/esm/stream.d.ts.map +1 -0
- package/esm/stream.js +7 -0
- package/esm/stream.js.map +1 -0
- package/esm/struct-deserialize.d.ts +7 -0
- package/esm/struct-deserialize.d.ts.map +1 -0
- package/esm/struct-deserialize.js +9 -0
- package/esm/struct-deserialize.js.map +1 -0
- package/esm/struct-serialize.d.ts +6 -0
- package/esm/struct-serialize.d.ts.map +1 -0
- package/esm/struct-serialize.js +11 -0
- package/esm/struct-serialize.js.map +1 -0
- package/esm/task.d.ts +5 -0
- package/esm/task.d.ts.map +1 -0
- package/esm/task.js +9 -0
- package/esm/task.js.map +1 -0
- package/esm/types.d.ts +777 -0
- package/esm/types.d.ts.map +1 -0
- package/esm/types.js +3 -0
- package/esm/types.js.map +1 -0
- package/esm/wrap-readable.d.ts +22 -0
- package/esm/wrap-readable.d.ts.map +1 -0
- package/esm/wrap-readable.js +57 -0
- package/esm/wrap-readable.js.map +1 -0
- package/esm/wrap-writable.d.ts +15 -0
- package/esm/wrap-writable.d.ts.map +1 -0
- package/esm/wrap-writable.js +63 -0
- package/esm/wrap-writable.js.map +1 -0
- package/package.json +48 -0
- package/src/buffered-transform.ts +71 -0
- package/src/buffered.ts +160 -0
- package/src/concat.ts +162 -0
- package/src/consumable.ts +205 -0
- package/src/distribution.ts +123 -0
- package/src/duplex.ts +146 -0
- package/src/encoding.ts +39 -0
- package/src/index.ts +18 -0
- package/src/inspect.ts +12 -0
- package/src/maybe-consumable.ts +101 -0
- package/src/pipe-from.ts +28 -0
- package/src/push-readable.ts +307 -0
- package/src/split-string.ts +32 -0
- package/src/stream.ts +46 -0
- package/src/struct-deserialize.ts +14 -0
- package/src/struct-serialize.ts +15 -0
- package/src/task.ts +21 -0
- package/src/types.ts +881 -0
- package/src/wrap-readable.ts +93 -0
- package/src/wrap-writable.ts +88 -0
- package/tsconfig.build.json +8 -0
- package/tsconfig.build.tsbuildinfo +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe-from.d.ts","sourceRoot":"","sources":["../src/pipe-from.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;GAQG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,EACzB,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,EAC3B,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,0CAanC"}
|
package/esm/pipe-from.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { WritableStream } from "./stream.js";
|
|
2
|
+
/**
|
|
3
|
+
* Pipe `pair.readable` to `writable`, then returns `pair.writable`.
|
|
4
|
+
*
|
|
5
|
+
* This is the opposite of `ReadableStream#pipeThrough()`.
|
|
6
|
+
*
|
|
7
|
+
* @param writable The `WritableStream` to write to.
|
|
8
|
+
* @param pair A `TransformStream` that converts chunks.
|
|
9
|
+
* @returns `pair`'s `writable` stream.
|
|
10
|
+
*/
|
|
11
|
+
export function pipeFrom(writable, pair) {
|
|
12
|
+
const writer = pair.writable.getWriter();
|
|
13
|
+
const pipe = pair.readable.pipeTo(writable);
|
|
14
|
+
return new WritableStream({
|
|
15
|
+
async write(chunk) {
|
|
16
|
+
await writer.write(chunk);
|
|
17
|
+
},
|
|
18
|
+
async close() {
|
|
19
|
+
await writer.close();
|
|
20
|
+
await pipe;
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=pipe-from.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipe-from.js","sourceRoot":"","sources":["../src/pipe-from.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;;;;;;;GAQG;AACH,MAAM,UAAU,QAAQ,CACpB,QAA2B,EAC3B,IAAgC;IAEhC,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;IACzC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC5C,OAAO,IAAI,cAAc,CAAI;QACzB,KAAK,CAAC,KAAK,CAAC,KAAK;YACb,MAAM,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC9B,CAAC;QACD,KAAK,CAAC,KAAK;YACP,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;YACrB,MAAM,IAAI,CAAC;QACf,CAAC;KACJ,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { AbortSignal, QueuingStrategy } from "./stream.js";
|
|
2
|
+
import { ReadableStream } from "./stream.js";
|
|
3
|
+
export interface PushReadableStreamController<T> {
|
|
4
|
+
abortSignal: AbortSignal;
|
|
5
|
+
enqueue(chunk: T): Promise<void>;
|
|
6
|
+
close(): void;
|
|
7
|
+
error(e?: unknown): void;
|
|
8
|
+
}
|
|
9
|
+
export type PushReadableStreamSource<T> = (controller: PushReadableStreamController<T>) => void | Promise<void>;
|
|
10
|
+
export type PushReadableLogger<T> = (event: {
|
|
11
|
+
source: "producer";
|
|
12
|
+
operation: "enqueue";
|
|
13
|
+
value: T;
|
|
14
|
+
phase: "start" | "waiting" | "ignored" | "complete";
|
|
15
|
+
} | {
|
|
16
|
+
source: "producer";
|
|
17
|
+
operation: "close" | "error";
|
|
18
|
+
explicit: boolean;
|
|
19
|
+
phase: "start" | "ignored" | "complete";
|
|
20
|
+
} | {
|
|
21
|
+
source: "consumer";
|
|
22
|
+
operation: "pull" | "cancel";
|
|
23
|
+
phase: "start" | "complete";
|
|
24
|
+
}) => void;
|
|
25
|
+
export declare class PushReadableStream<T> extends ReadableStream<T> {
|
|
26
|
+
/**
|
|
27
|
+
* Create a new `PushReadableStream` from a source.
|
|
28
|
+
*
|
|
29
|
+
* @param source If `source` returns a `Promise`, the stream will be closed
|
|
30
|
+
* when the `Promise` is resolved, and be errored when the `Promise` is rejected.
|
|
31
|
+
* @param strategy
|
|
32
|
+
*/
|
|
33
|
+
constructor(source: PushReadableStreamSource<T>, strategy?: QueuingStrategy<T>, logger?: PushReadableLogger<T>);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=push-readable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"push-readable.d.ts","sourceRoot":"","sources":["../src/push-readable.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAmB,cAAc,EAAE,MAAM,aAAa,CAAC;AAE9D,MAAM,WAAW,4BAA4B,CAAC,CAAC;IAC3C,WAAW,EAAE,WAAW,CAAC;IAEzB,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjC,KAAK,IAAI,IAAI,CAAC;IAEd,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,MAAM,wBAAwB,CAAC,CAAC,IAAI,CACtC,UAAU,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAC1C,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1B,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAChC,KAAK,EACC;IACI,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;CACvD,GACD;IACI,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAC;CAC3C,GACD;IACI,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC7B,KAAK,EAAE,OAAO,GAAG,UAAU,CAAC;CAC/B,KACN,IAAI,CAAC;AAEV,qBAAa,kBAAkB,CAAC,CAAC,CAAE,SAAQ,cAAc,CAAC,CAAC,CAAC;IACxD;;;;;;OAMG;gBAEC,MAAM,EAAE,wBAAwB,CAAC,CAAC,CAAC,EACnC,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAC7B,MAAM,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC;CA+PrC"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { PromiseResolver } from "@yume-chan/async";
|
|
2
|
+
import { AbortController, ReadableStream } from "./stream.js";
|
|
3
|
+
export class PushReadableStream extends ReadableStream {
|
|
4
|
+
/**
|
|
5
|
+
* Create a new `PushReadableStream` from a source.
|
|
6
|
+
*
|
|
7
|
+
* @param source If `source` returns a `Promise`, the stream will be closed
|
|
8
|
+
* when the `Promise` is resolved, and be errored when the `Promise` is rejected.
|
|
9
|
+
* @param strategy
|
|
10
|
+
*/
|
|
11
|
+
constructor(source, strategy, logger) {
|
|
12
|
+
let waterMarkLow;
|
|
13
|
+
let zeroHighWaterMarkAllowEnqueue = false;
|
|
14
|
+
const abortController = new AbortController();
|
|
15
|
+
super({
|
|
16
|
+
start: (controller) => {
|
|
17
|
+
const result = source({
|
|
18
|
+
abortSignal: abortController.signal,
|
|
19
|
+
enqueue: async (chunk) => {
|
|
20
|
+
logger?.({
|
|
21
|
+
source: "producer",
|
|
22
|
+
operation: "enqueue",
|
|
23
|
+
value: chunk,
|
|
24
|
+
phase: "start",
|
|
25
|
+
});
|
|
26
|
+
if (abortController.signal.aborted) {
|
|
27
|
+
// In original `ReadableStream`, calling `enqueue` or `close`
|
|
28
|
+
// on an cancelled stream will throw an error,
|
|
29
|
+
//
|
|
30
|
+
// But in `PushReadableStream`, `enqueue` is an async function,
|
|
31
|
+
// the producer can't just check `abortSignal.aborted`
|
|
32
|
+
// before calling `enqueue`, as it might change when waiting
|
|
33
|
+
// for the backpressure to be resolved.
|
|
34
|
+
//
|
|
35
|
+
// So IMO it's better to handle this for the producer
|
|
36
|
+
// by simply ignoring the `enqueue` call.
|
|
37
|
+
//
|
|
38
|
+
// Note that we check `abortSignal.aborted` instead of `stopped`,
|
|
39
|
+
// as it's not allowed for the producer to call `enqueue` after
|
|
40
|
+
// they called `close` or `error`.
|
|
41
|
+
//
|
|
42
|
+
// Obviously, the producer should listen to the `abortSignal` and
|
|
43
|
+
// stop producing, but most pushing data sources can't be stopped.
|
|
44
|
+
logger?.({
|
|
45
|
+
source: "producer",
|
|
46
|
+
operation: "enqueue",
|
|
47
|
+
value: chunk,
|
|
48
|
+
phase: "ignored",
|
|
49
|
+
});
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (controller.desiredSize === null) {
|
|
53
|
+
// `desiredSize` being `null` means the stream is in error state,
|
|
54
|
+
// `controller.enqueue` will throw an error for us.
|
|
55
|
+
controller.enqueue(chunk);
|
|
56
|
+
// istanbul ignore next
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (zeroHighWaterMarkAllowEnqueue) {
|
|
60
|
+
// When `highWaterMark` is set to `0`,
|
|
61
|
+
// `controller.desiredSize` will always be `0`,
|
|
62
|
+
// even if the consumer has called `reader.read()`.
|
|
63
|
+
// (in this case, each `reader.read()`/`pull`
|
|
64
|
+
// should allow one `enqueue` of any size)
|
|
65
|
+
//
|
|
66
|
+
// If the consumer has already called `reader.read()`,
|
|
67
|
+
// before the producer tries to `enqueue`,
|
|
68
|
+
// `controller.desiredSize` is `0` and normal `waterMarkLow` signal
|
|
69
|
+
// will never trigger,
|
|
70
|
+
// (because `ReadableStream` prevents reentrance of `pull`)
|
|
71
|
+
// The stream will stuck.
|
|
72
|
+
//
|
|
73
|
+
// So we need a special signal for this case.
|
|
74
|
+
zeroHighWaterMarkAllowEnqueue = false;
|
|
75
|
+
controller.enqueue(chunk);
|
|
76
|
+
logger?.({
|
|
77
|
+
source: "producer",
|
|
78
|
+
operation: "enqueue",
|
|
79
|
+
value: chunk,
|
|
80
|
+
phase: "complete",
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
if (controller.desiredSize <= 0) {
|
|
85
|
+
logger?.({
|
|
86
|
+
source: "producer",
|
|
87
|
+
operation: "enqueue",
|
|
88
|
+
value: chunk,
|
|
89
|
+
phase: "waiting",
|
|
90
|
+
});
|
|
91
|
+
waterMarkLow = new PromiseResolver();
|
|
92
|
+
await waterMarkLow.promise;
|
|
93
|
+
// Recheck consumer cancellation after async operations.
|
|
94
|
+
if (abortController.signal.aborted) {
|
|
95
|
+
logger?.({
|
|
96
|
+
source: "producer",
|
|
97
|
+
operation: "enqueue",
|
|
98
|
+
value: chunk,
|
|
99
|
+
phase: "ignored",
|
|
100
|
+
});
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
controller.enqueue(chunk);
|
|
105
|
+
logger?.({
|
|
106
|
+
source: "producer",
|
|
107
|
+
operation: "enqueue",
|
|
108
|
+
value: chunk,
|
|
109
|
+
phase: "complete",
|
|
110
|
+
});
|
|
111
|
+
},
|
|
112
|
+
close() {
|
|
113
|
+
logger?.({
|
|
114
|
+
source: "producer",
|
|
115
|
+
operation: "close",
|
|
116
|
+
explicit: true,
|
|
117
|
+
phase: "start",
|
|
118
|
+
});
|
|
119
|
+
// Since `enqueue` on an cancelled stream won't throw an error,
|
|
120
|
+
// so does `close`.
|
|
121
|
+
if (abortController.signal.aborted) {
|
|
122
|
+
logger?.({
|
|
123
|
+
source: "producer",
|
|
124
|
+
operation: "close",
|
|
125
|
+
explicit: true,
|
|
126
|
+
phase: "ignored",
|
|
127
|
+
});
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
controller.close();
|
|
131
|
+
logger?.({
|
|
132
|
+
source: "producer",
|
|
133
|
+
operation: "close",
|
|
134
|
+
explicit: true,
|
|
135
|
+
phase: "complete",
|
|
136
|
+
});
|
|
137
|
+
},
|
|
138
|
+
error(e) {
|
|
139
|
+
logger?.({
|
|
140
|
+
source: "producer",
|
|
141
|
+
operation: "error",
|
|
142
|
+
explicit: true,
|
|
143
|
+
phase: "start",
|
|
144
|
+
});
|
|
145
|
+
// Calling `error` on an already closed or errored stream is a no-op.
|
|
146
|
+
controller.error(e);
|
|
147
|
+
logger?.({
|
|
148
|
+
source: "producer",
|
|
149
|
+
operation: "error",
|
|
150
|
+
explicit: true,
|
|
151
|
+
phase: "complete",
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
if (result && "then" in result) {
|
|
156
|
+
// If `source` returns a `Promise`,
|
|
157
|
+
// close the stream when the `Promise` is resolved,
|
|
158
|
+
// and error the stream when the `Promise` is rejected.
|
|
159
|
+
// The producer can return a never-settling `Promise`
|
|
160
|
+
// to disable this behavior.
|
|
161
|
+
result.then(() => {
|
|
162
|
+
logger?.({
|
|
163
|
+
source: "producer",
|
|
164
|
+
operation: "close",
|
|
165
|
+
explicit: false,
|
|
166
|
+
phase: "start",
|
|
167
|
+
});
|
|
168
|
+
try {
|
|
169
|
+
controller.close();
|
|
170
|
+
logger?.({
|
|
171
|
+
source: "producer",
|
|
172
|
+
operation: "close",
|
|
173
|
+
explicit: false,
|
|
174
|
+
phase: "complete",
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
logger?.({
|
|
179
|
+
source: "producer",
|
|
180
|
+
operation: "close",
|
|
181
|
+
explicit: false,
|
|
182
|
+
phase: "ignored",
|
|
183
|
+
});
|
|
184
|
+
// The stream is already closed by the producer,
|
|
185
|
+
// Or cancelled by the consumer.
|
|
186
|
+
}
|
|
187
|
+
}, (e) => {
|
|
188
|
+
logger?.({
|
|
189
|
+
source: "producer",
|
|
190
|
+
operation: "error",
|
|
191
|
+
explicit: false,
|
|
192
|
+
phase: "start",
|
|
193
|
+
});
|
|
194
|
+
controller.error(e);
|
|
195
|
+
logger?.({
|
|
196
|
+
source: "producer",
|
|
197
|
+
operation: "error",
|
|
198
|
+
explicit: false,
|
|
199
|
+
phase: "complete",
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
pull: () => {
|
|
205
|
+
logger?.({
|
|
206
|
+
source: "consumer",
|
|
207
|
+
operation: "pull",
|
|
208
|
+
phase: "start",
|
|
209
|
+
});
|
|
210
|
+
if (waterMarkLow) {
|
|
211
|
+
waterMarkLow.resolve();
|
|
212
|
+
}
|
|
213
|
+
else if (strategy?.highWaterMark === 0) {
|
|
214
|
+
zeroHighWaterMarkAllowEnqueue = true;
|
|
215
|
+
}
|
|
216
|
+
logger?.({
|
|
217
|
+
source: "consumer",
|
|
218
|
+
operation: "pull",
|
|
219
|
+
phase: "complete",
|
|
220
|
+
});
|
|
221
|
+
},
|
|
222
|
+
cancel: (reason) => {
|
|
223
|
+
logger?.({
|
|
224
|
+
source: "consumer",
|
|
225
|
+
operation: "cancel",
|
|
226
|
+
phase: "start",
|
|
227
|
+
});
|
|
228
|
+
abortController.abort(reason);
|
|
229
|
+
// Resolve it on cancellation. `pull` will check `abortSignal.aborted` again.
|
|
230
|
+
waterMarkLow?.resolve();
|
|
231
|
+
logger?.({
|
|
232
|
+
source: "consumer",
|
|
233
|
+
operation: "cancel",
|
|
234
|
+
phase: "complete",
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
}, strategy);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
//# sourceMappingURL=push-readable.js.map
|
|
@@ -0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MAAM;oBACjB,KAAK,EAAE,OAAO;iBACjB,CAAC,CAAC;gBAEH,IAAI,YAAY,EAAE,CAAC;oBACf,YAAY,CAAC,OAAO,EAAE,CAAC;gBAC3B,CAAC;qBAAM,IAAI,QAAQ,EAAE,aAAa,KAAK,CAAC,EAAE,CAAC;oBACvC,6BAA6B,GAAG,IAAI,CAAC;gBACzC,CAAC;gBAED,MAAM,EAAE,CAAC;oBACL,MAAM,EAAE,UAAU;oBAClB,SAAS,EAAE,MAAM;oBACjB,KAAK,EAAE,UAAU;iBACpB,CAAC,CAAC;YACP,CAAC;YACD,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE;gBACf,MAAM,EAAE,CAAC;oBACL,MAAM,EAAE,UAAU;oBAClB,SAAS,EAAE,QAAQ;oBACnB,KAAK,EAAE,OAAO;iBACjB,CAAC,CAAC;gBAEH,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBAC9B,6EAA6E;gBAC7E,YAAY,EAAE,OAAO,EAAE,CAAC;gBAExB,MAAM,EAAE,CAAC;oBACL,MAAM,EAAE,UAAU;oBAClB,SAAS,EAAE,QAAQ;oBACnB,KAAK,EAAE,UAAU;iBACpB,CAAC,CAAC;YACP,CAAC;SACJ,EACD,QAAQ,CACX,CAAC;IACN,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-string.d.ts","sourceRoot":"","sources":["../src/split-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqB9C,qBAAa,iBAAkB,SAAQ,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC;gBACtD,SAAS,EAAE,MAAM;CAShC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { TransformStream } from "./stream.js";
|
|
2
|
+
function* split(input, separator) {
|
|
3
|
+
let start = 0;
|
|
4
|
+
while (true) {
|
|
5
|
+
const index = input.indexOf(separator, start);
|
|
6
|
+
if (index === -1) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
const part = input.substring(start, index);
|
|
10
|
+
yield part;
|
|
11
|
+
start = index + 1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class SplitStringStream extends TransformStream {
|
|
15
|
+
constructor(separator) {
|
|
16
|
+
super({
|
|
17
|
+
transform(chunk, controller) {
|
|
18
|
+
for (const part of split(chunk, separator)) {
|
|
19
|
+
controller.enqueue(part);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=split-string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-string.js","sourceRoot":"","sources":["../src/split-string.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,QAAQ,CAAC,CAAC,KAAK,CACX,KAAa,EACb,SAAiB;IAEjB,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAC9C,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACf,OAAO;QACX,CAAC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC3C,MAAM,IAAI,CAAC;QAEX,KAAK,GAAG,KAAK,GAAG,CAAC,CAAC;IACtB,CAAC;AACL,CAAC;AAED,MAAM,OAAO,iBAAkB,SAAQ,eAA+B;IAClE,YAAY,SAAiB;QACzB,KAAK,CAAC;YACF,SAAS,CAAC,KAAK,EAAE,UAAU;gBACvB,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAC;oBACzC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC;YACL,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/esm/stream.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AbortSignal, ReadableStream as ReadableStreamType, TransformStream as TransformStreamType, WritableStream as WritableStreamType } from "./types.js";
|
|
2
|
+
export * from "./types.js";
|
|
3
|
+
/** A controller object that allows you to abort one or more DOM requests as and when desired. */
|
|
4
|
+
export interface AbortController {
|
|
5
|
+
/**
|
|
6
|
+
* Returns the AbortSignal object associated with this object.
|
|
7
|
+
*/
|
|
8
|
+
readonly signal: AbortSignal;
|
|
9
|
+
/**
|
|
10
|
+
* Invoking this method will set this object's AbortSignal's aborted flag and signal to any observers that the associated activity is to be aborted.
|
|
11
|
+
*/
|
|
12
|
+
abort(reason?: unknown): void;
|
|
13
|
+
}
|
|
14
|
+
interface AbortControllerConstructor {
|
|
15
|
+
prototype: AbortController;
|
|
16
|
+
new (): AbortController;
|
|
17
|
+
}
|
|
18
|
+
export declare const AbortController: AbortControllerConstructor;
|
|
19
|
+
export type ReadableStream<out T> = ReadableStreamType<T>;
|
|
20
|
+
export declare const ReadableStream: typeof ReadableStreamType;
|
|
21
|
+
export type WritableStream<in T> = WritableStreamType<T>;
|
|
22
|
+
export declare const WritableStream: typeof WritableStreamType;
|
|
23
|
+
export type TransformStream<I, O> = TransformStreamType<I, O>;
|
|
24
|
+
export declare const TransformStream: typeof TransformStreamType;
|
|
25
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,WAAW,EACX,cAAc,IAAI,kBAAkB,EACpC,eAAe,IAAI,mBAAmB,EACtC,cAAc,IAAI,kBAAkB,EACvC,MAAM,YAAY,CAAC;AAEpB,cAAc,YAAY,CAAC;AAE3B,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAE7B;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;CACjC;AAED,UAAU,0BAA0B;IAChC,SAAS,EAAE,eAAe,CAAC;IAC3B,QAAQ,eAAe,CAAC;CAC3B;AAWD,eAAO,MAAM,eAAe,4BAAyB,CAAC;AAEtD,MAAM,MAAM,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAC;AAC1D,eAAO,MAAM,cAAc,2BAAwB,CAAC;AAEpD,MAAM,MAAM,cAAc,CAAC,EAAE,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAAC;AACzD,eAAO,MAAM,cAAc,2BAAwB,CAAC;AAEpD,MAAM,MAAM,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,mBAAmB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC9D,eAAO,MAAM,eAAe,4BAAyB,CAAC"}
|
package/esm/stream.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from "./types.js";
|
|
2
|
+
const Global = globalThis;
|
|
3
|
+
export const AbortController = Global.AbortController;
|
|
4
|
+
export const ReadableStream = Global.ReadableStream;
|
|
5
|
+
export const WritableStream = Global.WritableStream;
|
|
6
|
+
export const TransformStream = Global.TransformStream;
|
|
7
|
+
//# sourceMappingURL=stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../src/stream.ts"],"names":[],"mappings":"AAOA,cAAc,YAAY,CAAC;AA2B3B,MAAM,MAAM,GAAG,UAAwC,CAAC;AAExD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;AAGtD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAGpD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;AAGpD,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type Struct from "@yume-chan/struct";
|
|
2
|
+
import type { StructValueType } from "@yume-chan/struct";
|
|
3
|
+
import { BufferedTransformStream } from "./buffered-transform.js";
|
|
4
|
+
export declare class StructDeserializeStream<T extends Struct<object, PropertyKey, object, unknown>> extends BufferedTransformStream<StructValueType<T>> {
|
|
5
|
+
constructor(struct: T);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=struct-deserialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"struct-deserialize.d.ts","sourceRoot":"","sources":["../src/struct-deserialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,qBAAa,uBAAuB,CAChC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CACxD,SAAQ,uBAAuB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBACrC,MAAM,EAAE,CAAC;CAKxB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BufferedTransformStream } from "./buffered-transform.js";
|
|
2
|
+
export class StructDeserializeStream extends BufferedTransformStream {
|
|
3
|
+
constructor(struct) {
|
|
4
|
+
super((stream) => {
|
|
5
|
+
return struct.deserialize(stream);
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=struct-deserialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"struct-deserialize.js","sourceRoot":"","sources":["../src/struct-deserialize.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,OAAO,uBAEX,SAAQ,uBAA2C;IACjD,YAAY,MAAS;QACjB,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;YACb,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAU,CAAC;QAC/C,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type Struct from "@yume-chan/struct";
|
|
2
|
+
import { TransformStream } from "./stream.js";
|
|
3
|
+
export declare class StructSerializeStream<T extends Struct<object, PropertyKey, object, unknown>> extends TransformStream<T["TInit"], Uint8Array> {
|
|
4
|
+
constructor(struct: T);
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=struct-serialize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"struct-serialize.d.ts","sourceRoot":"","sources":["../src/struct-serialize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,qBAAa,qBAAqB,CAC9B,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,CACxD,SAAQ,eAAe,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,UAAU,CAAC;gBACjC,MAAM,EAAE,CAAC;CAOxB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TransformStream } from "./stream.js";
|
|
2
|
+
export class StructSerializeStream extends TransformStream {
|
|
3
|
+
constructor(struct) {
|
|
4
|
+
super({
|
|
5
|
+
transform(chunk, controller) {
|
|
6
|
+
controller.enqueue(struct.serialize(chunk));
|
|
7
|
+
},
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=struct-serialize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"struct-serialize.js","sourceRoot":"","sources":["../src/struct-serialize.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,OAAO,qBAEX,SAAQ,eAAuC;IAC7C,YAAY,MAAS;QACjB,KAAK,CAAC;YACF,SAAS,CAAC,KAAK,EAAE,UAAU;gBACvB,UAAU,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;YAChD,CAAC;SACJ,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/esm/task.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACjB,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;CAChC;AAYD,eAAO,MAAM,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAMpC,CAAC"}
|
package/esm/task.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// `createTask` allows browser DevTools to track the call stack across async boundaries.
|
|
2
|
+
const { console } = globalThis;
|
|
3
|
+
export const createTask = console?.createTask?.bind(console) ??
|
|
4
|
+
(() => ({
|
|
5
|
+
run(callback) {
|
|
6
|
+
return callback();
|
|
7
|
+
},
|
|
8
|
+
}));
|
|
9
|
+
//# sourceMappingURL=task.js.map
|
package/esm/task.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAYA,wFAAwF;AACxF,MAAM,EAAE,OAAO,EAAE,GAAG,UAAwC,CAAC;AAC7D,MAAM,CAAC,MAAM,UAAU,GACnB,OAAO,EAAE,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC;IAClC,CAAC,GAAG,EAAE,CAAC,CAAC;QACJ,GAAG,CAAC,QAAQ;YACR,OAAO,QAAQ,EAAE,CAAC;QACtB,CAAC;KACJ,CAAC,CAAC,CAAC"}
|