@xsai/utils-stream 0.4.4 → 0.5.0-beta.2

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/dist/index.d.ts CHANGED
@@ -16,7 +16,5 @@ interface SmoothStreamOptions {
16
16
  */
17
17
  declare const smoothStream: ({ chunking, delay }?: SmoothStreamOptions) => TransformStream<string, string>;
18
18
 
19
- declare function readableStreamToAsyncIterator<T>(res: ReadableStream<T>): AsyncGenerator<T, void, unknown>;
20
-
21
- export { simulateReadableStream, smoothStream, readableStreamToAsyncIterator as toAsyncIterator };
19
+ export { simulateReadableStream, smoothStream };
22
20
  export type { SimulateReadableStreamOptions, SmoothStreamOptions };
package/dist/index.js CHANGED
@@ -34,21 +34,4 @@ const smoothStream = ({ chunking = "word", delay = 10 } = {}) => {
34
34
  });
35
35
  };
36
36
 
37
- async function* readableStreamToAsyncIterator(res) {
38
- if (res[Symbol.asyncIterator])
39
- yield* res[Symbol.asyncIterator]();
40
- const reader = res.getReader();
41
- try {
42
- while (true) {
43
- const { done, value } = await reader.read();
44
- if (done) {
45
- return;
46
- }
47
- yield value;
48
- }
49
- } finally {
50
- reader.releaseLock();
51
- }
52
- }
53
-
54
- export { simulateReadableStream, smoothStream, readableStreamToAsyncIterator as toAsyncIterator };
37
+ export { simulateReadableStream, smoothStream };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/utils-stream",
3
3
  "type": "module",
4
- "version": "0.4.4",
4
+ "version": "0.5.0-beta.2",
5
5
  "description": "extra-small AI SDK.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "dist"
30
30
  ],
31
31
  "devDependencies": {
32
- "@moeru/std": "^0.1.0-beta.15"
32
+ "@moeru/std": "^0.1.0-beta.17"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "pkgroll"