@ai-sdk/provider-utils 4.0.50 → 4.0.52
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 4.0.52
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 82e18b0: fix(provider-utils): avoid excessive memory usage when base64 encoding byte arrays
|
|
8
|
+
|
|
9
|
+
## 4.0.51
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [1a4dbb1]
|
|
14
|
+
- @ai-sdk/provider@3.0.16
|
|
15
|
+
|
|
3
16
|
## 4.0.50
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -271,11 +271,12 @@ function convertBase64ToUint8Array(base64String) {
|
|
|
271
271
|
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
272
272
|
}
|
|
273
273
|
function convertUint8ArrayToBase64(array) {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
274
|
+
const chunks = [];
|
|
275
|
+
const chunkSize = 4096;
|
|
276
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
277
|
+
chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));
|
|
277
278
|
}
|
|
278
|
-
return btoa(
|
|
279
|
+
return btoa(chunks.join(""));
|
|
279
280
|
}
|
|
280
281
|
function convertToBase64(value) {
|
|
281
282
|
return value instanceof Uint8Array ? convertUint8ArrayToBase64(value) : value;
|
|
@@ -922,7 +923,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
922
923
|
}
|
|
923
924
|
|
|
924
925
|
// src/version.ts
|
|
925
|
-
var VERSION = true ? "4.0.
|
|
926
|
+
var VERSION = true ? "4.0.52" : "0.0.0-test";
|
|
926
927
|
|
|
927
928
|
// src/get-from-api.ts
|
|
928
929
|
var getOriginalFetch = () => globalThis.fetch;
|