@ai-sdk/provider-utils 5.0.35 → 5.0.37

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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 5.0.37
4
+
5
+ ### Patch Changes
6
+
7
+ - 9e1d1b2: chore(provider-utils): fix test that can timeout
8
+ - a495511: fix(provider-utils): avoid excessive memory usage when base64 encoding byte arrays
9
+ - Updated dependencies [a4ba394]
10
+ - Updated dependencies [45099da]
11
+ - @ai-sdk/provider@4.0.11
12
+
13
+ ## 5.0.36
14
+
15
+ ### Patch Changes
16
+
17
+ - 6bcc0f8: Update Undici to a version patched for CVE-2026-13697.
18
+
3
19
  ## 5.0.35
4
20
 
5
21
  ### 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
- let latin1string = "";
219
- for (let i = 0; i < array.length; i++) {
220
- latin1string += String.fromCodePoint(array[i]);
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(latin1string);
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.35" : "0.0.0-test";
521
+ var VERSION = true ? "5.0.37" : "0.0.0-test";
521
522
 
522
523
  // src/normalize-headers.ts
523
524
  function normalizeHeaders(headers) {