@ai-sdk/provider-utils
Advanced tools
+2
-2
| { | ||
| "name": "@ai-sdk/provider-utils", | ||
| "version": "5.0.24", | ||
| "version": "5.0.25", | ||
| "type": "module", | ||
@@ -39,3 +39,3 @@ "license": "Apache-2.0", | ||
| "undici": "^7.28.0", | ||
| "@ai-sdk/provider": "4.0.6" | ||
| "@ai-sdk/provider": "4.0.7" | ||
| }, | ||
@@ -42,0 +42,0 @@ "devDependencies": { |
+9
-10
@@ -7,3 +7,4 @@ import { TypeValidationError, type JSONSchema7 } from '@ai-sdk/provider'; | ||
| import type * as z3 from 'zod/v3'; | ||
| import * as z4 from 'zod/v4'; | ||
| import { safeParseAsync } from 'zod/v4'; | ||
| import { toJSONSchema, type $ZodType } from 'zod/v4/core'; | ||
| import { addAdditionalPropertiesToJsonSchema } from './add-additional-properties-to-json-schema'; | ||
@@ -71,3 +72,3 @@ import { zod3ToJsonSchema } from './to-json-schema/zod3-to-json-schema'; | ||
| | z3.Schema<SCHEMA, z3.ZodTypeDef, any> | ||
| | z4.core.$ZodType<SCHEMA, any>; | ||
| | $ZodType<SCHEMA, any>; | ||
@@ -234,3 +235,3 @@ export type StandardSchema<SCHEMA = any> = StandardSchemaV1<unknown, SCHEMA> & { | ||
| export function zod4Schema<OBJECT>( | ||
| zodSchema: z4.core.$ZodType<OBJECT, any>, | ||
| zodSchema: $ZodType<OBJECT, any>, | ||
| options?: { | ||
@@ -253,3 +254,3 @@ /** | ||
| addAdditionalPropertiesToJsonSchema( | ||
| z4.toJSONSchema(zodSchema, { | ||
| toJSONSchema(zodSchema, { | ||
| target: 'draft-7', | ||
@@ -262,3 +263,3 @@ io: 'input', | ||
| validate: async value => { | ||
| const result = await z4.safeParseAsync(zodSchema, value); | ||
| const result = await safeParseAsync(zodSchema, value); | ||
| return result.success | ||
@@ -273,4 +274,4 @@ ? { success: true, value: result.data } | ||
| export function isZod4Schema( | ||
| zodSchema: z4.core.$ZodType<any, any> | z3.Schema<any, z3.ZodTypeDef, any>, | ||
| ): zodSchema is z4.core.$ZodType<any, any> { | ||
| zodSchema: $ZodType<any, any> | z3.Schema<any, z3.ZodTypeDef, any>, | ||
| ): zodSchema is $ZodType<any, any> { | ||
| // https://zod.dev/library-authors?id=how-to-support-zod-3-and-zod-4-simultaneously | ||
@@ -281,5 +282,3 @@ return '_zod' in zodSchema; | ||
| export function zodSchema<OBJECT>( | ||
| zodSchema: | ||
| | z4.core.$ZodType<OBJECT, any> | ||
| | z3.Schema<OBJECT, z3.ZodTypeDef, any>, | ||
| zodSchema: $ZodType<OBJECT, any> | z3.Schema<OBJECT, z3.ZodTypeDef, any>, | ||
| options?: { | ||
@@ -286,0 +285,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
885578
0.03%+ Added
- Removed
Updated