@ai-sdk/provider-utils 4.0.46 → 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 +12 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/add-additional-properties-to-json-schema.ts +9 -2
- package/src/safe-node-fetch.ts +5 -1
package/dist/index.mjs
CHANGED
|
@@ -447,6 +447,9 @@ async function getDefaultDownloadFetch() {
|
|
|
447
447
|
return safeNodeFetchPromise != null ? safeNodeFetchPromise : safeNodeFetchPromise = createSafeNodeFetch();
|
|
448
448
|
}
|
|
449
449
|
function isNodeDefaultFetch(fetch) {
|
|
450
|
+
if (typeof fetch !== "function") {
|
|
451
|
+
return false;
|
|
452
|
+
}
|
|
450
453
|
const source = Function.prototype.toString.call(fetch);
|
|
451
454
|
return source.includes("internal/deps/undici") || source.includes("lazy loading of undici");
|
|
452
455
|
}
|
|
@@ -790,7 +793,7 @@ function withUserAgentSuffix(headers, ...userAgentSuffixParts) {
|
|
|
790
793
|
}
|
|
791
794
|
|
|
792
795
|
// src/version.ts
|
|
793
|
-
var VERSION = true ? "4.0.
|
|
796
|
+
var VERSION = true ? "4.0.48" : "0.0.0-test";
|
|
794
797
|
|
|
795
798
|
// src/get-from-api.ts
|
|
796
799
|
var getOriginalFetch = () => globalThis.fetch;
|
|
@@ -1097,7 +1100,8 @@ import * as z4 from "zod/v4";
|
|
|
1097
1100
|
// src/add-additional-properties-to-json-schema.ts
|
|
1098
1101
|
function addAdditionalPropertiesToJsonSchema(jsonSchema2) {
|
|
1099
1102
|
if (jsonSchema2.type === "object" || Array.isArray(jsonSchema2.type) && jsonSchema2.type.includes("object")) {
|
|
1100
|
-
|
|
1103
|
+
const { additionalProperties } = jsonSchema2;
|
|
1104
|
+
jsonSchema2.additionalProperties = additionalProperties != null && typeof additionalProperties !== "boolean" ? visit(additionalProperties) : false;
|
|
1101
1105
|
const { properties } = jsonSchema2;
|
|
1102
1106
|
if (properties != null) {
|
|
1103
1107
|
for (const key of Object.keys(properties)) {
|