@ai-sdk/provider-utils 5.0.25 → 5.0.26

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,11 @@
1
1
  # @ai-sdk/provider-utils
2
2
 
3
+ ## 5.0.26
4
+
5
+ ### Patch Changes
6
+
7
+ - 401a4ba: fix(provider-utils): allow imports in runtimes without a global fetch function
8
+
3
9
  ## 5.0.25
4
10
 
5
11
  ### 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
  }
@@ -1325,7 +1328,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
1325
1328
  }
1326
1329
 
1327
1330
  // src/version.ts
1328
- var VERSION = true ? "5.0.25" : "0.0.0-test";
1331
+ var VERSION = true ? "5.0.26" : "0.0.0-test";
1329
1332
 
1330
1333
  // src/get-from-api.ts
1331
1334
  var getOriginalFetch = () => globalThis.fetch;