@ai-sdk/provider-utils 4.0.47 → 4.0.48

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
+ ## 4.0.48
4
+
5
+ ### Patch Changes
6
+
7
+ - 5642849: fix(provider-utils): allow imports in runtimes without a global fetch function
8
+
3
9
  ## 4.0.47
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -549,6 +549,9 @@ async function getDefaultDownloadFetch() {
549
549
  return safeNodeFetchPromise != null ? safeNodeFetchPromise : safeNodeFetchPromise = createSafeNodeFetch();
550
550
  }
551
551
  function isNodeDefaultFetch(fetch) {
552
+ if (typeof fetch !== "function") {
553
+ return false;
554
+ }
552
555
  const source = Function.prototype.toString.call(fetch);
553
556
  return source.includes("internal/deps/undici") || source.includes("lazy loading of undici");
554
557
  }
@@ -892,7 +895,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
892
895
  }
893
896
 
894
897
  // src/version.ts
895
- var VERSION = true ? "4.0.47" : "0.0.0-test";
898
+ var VERSION = true ? "4.0.48" : "0.0.0-test";
896
899
 
897
900
  // src/get-from-api.ts
898
901
  var getOriginalFetch = () => globalThis.fetch;