@yume-chan/stream-extra 0.0.18 → 0.0.20
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.json +27 -0
- package/CHANGELOG.md +16 -1
- package/README.md +1 -1
- package/esm/buffered-transform.d.ts +10 -10
- package/esm/buffered-transform.d.ts.map +1 -1
- package/esm/buffered-transform.js +56 -55
- package/esm/buffered-transform.js.map +1 -1
- package/esm/buffered.d.ts +24 -27
- package/esm/buffered.d.ts.map +1 -1
- package/esm/buffered.js +132 -123
- package/esm/buffered.js.map +1 -1
- package/esm/consumable.d.ts +52 -0
- package/esm/consumable.d.ts.map +1 -0
- package/esm/consumable.js +178 -0
- package/esm/consumable.js.map +1 -0
- package/esm/decode-utf8.d.ts +4 -4
- package/esm/decode-utf8.js +11 -11
- package/esm/distribution.d.ts +21 -0
- package/esm/distribution.d.ts.map +1 -0
- package/esm/distribution.js +99 -0
- package/esm/distribution.js.map +1 -0
- package/esm/duplex.d.ts +44 -47
- package/esm/duplex.d.ts.map +1 -1
- package/esm/duplex.js +92 -92
- package/esm/duplex.js.map +1 -1
- package/esm/gather-string.d.ts +6 -6
- package/esm/gather-string.d.ts.map +1 -1
- package/esm/gather-string.js +15 -13
- package/esm/gather-string.js.map +1 -1
- package/esm/index.d.ts +16 -15
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +16 -15
- package/esm/index.js.map +1 -1
- package/esm/inspect.d.ts +4 -4
- package/esm/inspect.js +11 -11
- package/esm/pipe-from.d.ts +12 -11
- package/esm/pipe-from.d.ts.map +1 -1
- package/esm/pipe-from.js +23 -25
- package/esm/pipe-from.js.map +1 -1
- package/esm/push-readable.d.ts +19 -18
- package/esm/push-readable.d.ts.map +1 -1
- package/esm/push-readable.js +66 -61
- package/esm/push-readable.js.map +1 -1
- package/esm/split-string.d.ts +4 -4
- package/esm/split-string.d.ts.map +1 -1
- package/esm/split-string.js +24 -24
- package/esm/split-string.js.map +1 -1
- package/esm/stream.d.ts +25 -24
- package/esm/stream.d.ts.map +1 -1
- package/esm/stream.js +26 -26
- package/esm/stream.js.map +1 -1
- package/esm/struct-deserialize.d.ts +6 -6
- package/esm/struct-deserialize.d.ts.map +1 -1
- package/esm/struct-deserialize.js +8 -8
- package/esm/struct-serialize.d.ts +5 -5
- package/esm/struct-serialize.js +10 -10
- package/esm/wrap-readable.d.ts +21 -20
- package/esm/wrap-readable.d.ts.map +1 -1
- package/esm/wrap-readable.js +56 -56
- package/esm/wrap-readable.js.map +1 -1
- package/esm/wrap-writable.d.ts +14 -12
- package/esm/wrap-writable.d.ts.map +1 -1
- package/esm/wrap-writable.js +62 -52
- package/esm/wrap-writable.js.map +1 -1
- package/package.json +9 -8
- package/src/buffered-transform.ts +15 -22
- package/src/buffered.ts +41 -33
- package/src/consumable.ts +281 -0
- package/src/distribution.ts +113 -0
- package/src/duplex.ts +35 -34
- package/src/gather-string.ts +6 -4
- package/src/index.ts +16 -15
- package/src/inspect.ts +1 -1
- package/src/pipe-from.ts +8 -6
- package/src/push-readable.ts +12 -12
- package/src/split-string.ts +5 -2
- package/src/stream.ts +1 -1
- package/src/struct-deserialize.ts +1 -1
- package/src/wrap-readable.ts +9 -9
- package/src/wrap-writable.ts +21 -9
- package/tsconfig.build.json +6 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/esm/chunk.d.ts +0 -5
- package/esm/chunk.d.ts.map +0 -1
- package/esm/chunk.js +0 -15
- package/esm/chunk.js.map +0 -1
- package/esm/trace.d.ts +0 -16
- package/esm/trace.d.ts.map +0 -1
- package/esm/trace.js +0 -131
- package/esm/trace.js.map +0 -1
- package/src/chunk.ts +0 -15
package/src/chunk.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { TransformStream } from "./stream.js";
|
|
2
|
-
|
|
3
|
-
export class ChunkStream extends TransformStream<Uint8Array, Uint8Array>{
|
|
4
|
-
public constructor(size: number) {
|
|
5
|
-
super({
|
|
6
|
-
transform(chunk, controller) {
|
|
7
|
-
for (let start = 0; start < chunk.byteLength;) {
|
|
8
|
-
const end = start + size;
|
|
9
|
-
controller.enqueue(chunk.subarray(start, end));
|
|
10
|
-
start = end;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
}
|
|
15
|
-
}
|