@ai-sdk/provider-utils 5.0.36 → 5.0.38
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 +17 -0
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/uint8-utils.ts +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.38
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [912fb01]
|
|
8
|
+
- @ai-sdk/provider@4.0.12
|
|
9
|
+
|
|
10
|
+
## 5.0.37
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 9e1d1b2: chore(provider-utils): fix test that can timeout
|
|
15
|
+
- a495511: fix(provider-utils): avoid excessive memory usage when base64 encoding byte arrays
|
|
16
|
+
- Updated dependencies [a4ba394]
|
|
17
|
+
- Updated dependencies [45099da]
|
|
18
|
+
- @ai-sdk/provider@4.0.11
|
|
19
|
+
|
|
3
20
|
## 5.0.36
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -215,11 +215,12 @@ function convertBase64ToUint8Array(base64String) {
|
|
|
215
215
|
return Uint8Array.from(latin1string, (byte) => byte.codePointAt(0));
|
|
216
216
|
}
|
|
217
217
|
function convertUint8ArrayToBase64(array) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
218
|
+
const chunks = [];
|
|
219
|
+
const chunkSize = 4096;
|
|
220
|
+
for (let i = 0; i < array.length; i += chunkSize) {
|
|
221
|
+
chunks.push(String.fromCodePoint(...array.subarray(i, i + chunkSize)));
|
|
221
222
|
}
|
|
222
|
-
return btoa(
|
|
223
|
+
return btoa(chunks.join(""));
|
|
223
224
|
}
|
|
224
225
|
function convertToBase64(value) {
|
|
225
226
|
return value instanceof Uint8Array ? convertUint8ArrayToBase64(value) : value;
|
|
@@ -517,7 +518,7 @@ function handleFetchError({
|
|
|
517
518
|
}
|
|
518
519
|
|
|
519
520
|
// src/version.ts
|
|
520
|
-
var VERSION = true ? "5.0.
|
|
521
|
+
var VERSION = true ? "5.0.38" : "0.0.0-test";
|
|
521
522
|
|
|
522
523
|
// src/normalize-headers.ts
|
|
523
524
|
function normalizeHeaders(headers) {
|