@ai-sdk/provider-utils 0.0.13 → 0.0.15
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.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +37 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/dist/index.d.mts +11 -2
- package/test/dist/index.d.ts +11 -2
- package/test/dist/index.js +33 -3
- package/test/dist/index.js.map +1 -1
- package/test/dist/index.mjs +30 -3
- package/test/dist/index.mjs.map +1 -1
package/test/dist/index.mjs
CHANGED
@@ -27,12 +27,33 @@ var __privateMethod = (obj, member, method) => {
|
|
27
27
|
return method;
|
28
28
|
};
|
29
29
|
|
30
|
-
// src/test/convert-
|
31
|
-
|
30
|
+
// src/test/convert-array-to-readable-stream.ts
|
31
|
+
function convertArrayToReadableStream(values) {
|
32
|
+
return new ReadableStream({
|
33
|
+
start(controller) {
|
34
|
+
for (const value of values) {
|
35
|
+
controller.enqueue(value);
|
36
|
+
}
|
37
|
+
controller.close();
|
38
|
+
}
|
39
|
+
});
|
40
|
+
}
|
41
|
+
|
42
|
+
// src/test/convert-async-iterable-to-array.ts
|
43
|
+
async function convertAsyncIterableToArray(iterable) {
|
32
44
|
const result = [];
|
45
|
+
for await (const item of iterable) {
|
46
|
+
result.push(item);
|
47
|
+
}
|
48
|
+
return result;
|
49
|
+
}
|
50
|
+
|
51
|
+
// src/test/convert-readable-stream-to-array.ts
|
52
|
+
async function convertReadableStreamToArray(stream) {
|
33
53
|
const reader = stream.getReader();
|
54
|
+
const result = [];
|
34
55
|
while (true) {
|
35
|
-
const {
|
56
|
+
const { done, value } = await reader.read();
|
36
57
|
if (done)
|
37
58
|
break;
|
38
59
|
result.push(value);
|
@@ -8256,9 +8277,15 @@ var StreamingTestServer = class {
|
|
8256
8277
|
afterAll(() => this.server.close());
|
8257
8278
|
}
|
8258
8279
|
};
|
8280
|
+
|
8281
|
+
// src/test/index.ts
|
8282
|
+
var convertStreamToArray = convertReadableStreamToArray;
|
8259
8283
|
export {
|
8260
8284
|
JsonTestServer,
|
8261
8285
|
StreamingTestServer,
|
8286
|
+
convertArrayToReadableStream,
|
8287
|
+
convertAsyncIterableToArray,
|
8288
|
+
convertReadableStreamToArray,
|
8262
8289
|
convertStreamToArray
|
8263
8290
|
};
|
8264
8291
|
/*! Bundled license information:
|