@ai-sdk/google 2.0.105 → 2.0.107
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 +13 -0
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -1
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +5 -0
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +5 -0
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +5 -5
package/dist/internal/index.mjs
CHANGED
|
@@ -170,6 +170,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
|
|
|
170
170
|
const nonNullTypes = type.filter((t) => t !== "null");
|
|
171
171
|
if (nonNullTypes.length === 0) {
|
|
172
172
|
result.type = "null";
|
|
173
|
+
} else if (nonNullTypes.length === 1) {
|
|
174
|
+
result.type = nonNullTypes[0];
|
|
175
|
+
if (hasNull) {
|
|
176
|
+
result.nullable = true;
|
|
177
|
+
}
|
|
173
178
|
} else {
|
|
174
179
|
result.anyOf = nonNullTypes.map((t) => ({ type: t }));
|
|
175
180
|
if (hasNull) {
|