@ai-sdk/provider-utils 5.0.25 → 5.0.27
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 +12 -0
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/read-response-with-size-limit.ts +2 -0
- package/src/safe-node-fetch.ts +5 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @ai-sdk/provider-utils
|
|
2
2
|
|
|
3
|
+
## 5.0.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7fbfc6d: Preserve streamed download size-limit errors when response cancellation fails.
|
|
8
|
+
|
|
9
|
+
## 5.0.26
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 401a4ba: fix(provider-utils): allow imports in runtimes without a global fetch function
|
|
14
|
+
|
|
3
15
|
## 5.0.25
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -922,6 +922,9 @@ async function getDefaultDownloadFetch() {
|
|
|
922
922
|
return safeNodeFetchPromise != null ? safeNodeFetchPromise : safeNodeFetchPromise = Promise.resolve().then(createSafeNodeFetch);
|
|
923
923
|
}
|
|
924
924
|
function isNodeDefaultFetch(fetch) {
|
|
925
|
+
if (typeof fetch !== "function") {
|
|
926
|
+
return false;
|
|
927
|
+
}
|
|
925
928
|
const source = Function.prototype.toString.call(fetch);
|
|
926
929
|
return source.includes("internal/deps/undici") || source.includes("lazy loading of undici");
|
|
927
930
|
}
|
|
@@ -1106,6 +1109,7 @@ async function readResponseWithSizeLimit({
|
|
|
1106
1109
|
} finally {
|
|
1107
1110
|
try {
|
|
1108
1111
|
await reader.cancel();
|
|
1112
|
+
} catch (e) {
|
|
1109
1113
|
} finally {
|
|
1110
1114
|
reader.releaseLock();
|
|
1111
1115
|
}
|
|
@@ -1325,7 +1329,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
1325
1329
|
}
|
|
1326
1330
|
|
|
1327
1331
|
// src/version.ts
|
|
1328
|
-
var VERSION = true ? "5.0.
|
|
1332
|
+
var VERSION = true ? "5.0.27" : "0.0.0-test";
|
|
1329
1333
|
|
|
1330
1334
|
// src/get-from-api.ts
|
|
1331
1335
|
var getOriginalFetch = () => globalThis.fetch;
|