@ai-sdk/provider-utils 4.0.51 → 4.0.53
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 +13 -0
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/uint8-utils.ts +5 -4
package/dist/index.mjs
CHANGED
|
@@ -168,11 +168,12 @@ function convertBase64ToUint8Array(base64String) {
|
|
|
168
168
|
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
169
169
|
}
|
|
170
170
|
function convertUint8ArrayToBase64(array) {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
const chunks = [];
|
|
172
|
+
const chunkSize = 4096;
|
|
173
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
174
|
+
chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));
|
|
174
175
|
}
|
|
175
|
-
return btoa(
|
|
176
|
+
return btoa(chunks.join(""));
|
|
176
177
|
}
|
|
177
178
|
function convertToBase64(value) {
|
|
178
179
|
return value instanceof Uint8Array ? convertUint8ArrayToBase64(value) : value;
|
|
@@ -819,7 +820,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
819
820
|
}
|
|
820
821
|
|
|
821
822
|
// src/version.ts
|
|
822
|
-
var VERSION = true ? "4.0.
|
|
823
|
+
var VERSION = true ? "4.0.53" : "0.0.0-test";
|
|
823
824
|
|
|
824
825
|
// src/get-from-api.ts
|
|
825
826
|
var getOriginalFetch = () => globalThis.fetch;
|