@ai-sdk/provider-utils 0.0.15 → 1.0.0
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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +25 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/test/dist/index.d.mts +5 -3
- package/test/dist/index.d.ts +5 -3
- package/test/dist/index.js +25 -2
- package/test/dist/index.js.map +1 -1
- package/test/dist/index.mjs +24 -2
- package/test/dist/index.mjs.map +1 -1
package/test/dist/index.mjs
CHANGED
@@ -39,6 +39,17 @@ function convertArrayToReadableStream(values) {
|
|
39
39
|
});
|
40
40
|
}
|
41
41
|
|
42
|
+
// src/test/convert-array-to-async-iterable.ts
|
43
|
+
function convertArrayToAsyncIterable(values) {
|
44
|
+
return {
|
45
|
+
async *[Symbol.asyncIterator]() {
|
46
|
+
for (const value of values) {
|
47
|
+
yield value;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
};
|
51
|
+
}
|
52
|
+
|
42
53
|
// src/test/convert-async-iterable-to-array.ts
|
43
54
|
async function convertAsyncIterableToArray(iterable) {
|
44
55
|
const result = [];
|
@@ -8213,7 +8224,12 @@ var JsonTestServer = class {
|
|
8213
8224
|
}
|
8214
8225
|
async getRequestHeaders() {
|
8215
8226
|
expect(this.request).toBeDefined();
|
8216
|
-
|
8227
|
+
const requestHeaders = this.request.headers;
|
8228
|
+
const headersObject = {};
|
8229
|
+
requestHeaders.forEach((value, key) => {
|
8230
|
+
headersObject[key] = value;
|
8231
|
+
});
|
8232
|
+
return headersObject;
|
8217
8233
|
}
|
8218
8234
|
setupTestEnvironment() {
|
8219
8235
|
beforeAll(() => this.server.listen());
|
@@ -8265,7 +8281,12 @@ var StreamingTestServer = class {
|
|
8265
8281
|
}
|
8266
8282
|
async getRequestHeaders() {
|
8267
8283
|
expect(this.request).toBeDefined();
|
8268
|
-
|
8284
|
+
const requestHeaders = this.request.headers;
|
8285
|
+
const headersObject = {};
|
8286
|
+
requestHeaders.forEach((value, key) => {
|
8287
|
+
headersObject[key] = value;
|
8288
|
+
});
|
8289
|
+
return headersObject;
|
8269
8290
|
}
|
8270
8291
|
setupTestEnvironment() {
|
8271
8292
|
beforeAll(() => this.server.listen());
|
@@ -8283,6 +8304,7 @@ var convertStreamToArray = convertReadableStreamToArray;
|
|
8283
8304
|
export {
|
8284
8305
|
JsonTestServer,
|
8285
8306
|
StreamingTestServer,
|
8307
|
+
convertArrayToAsyncIterable,
|
8286
8308
|
convertArrayToReadableStream,
|
8287
8309
|
convertAsyncIterableToArray,
|
8288
8310
|
convertReadableStreamToArray,
|