@blocklet/pages-kit-block-studio 0.6.18 → 0.6.20

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.
@@ -230,5 +230,12 @@ export function zodSchemaToTypeString(schema, typeName, removeUndefined = true)
230
230
  * 从Zod schema生成JSON Schema
231
231
  */
232
232
  export function zodSchemaToJsonSchema(schema) {
233
+ // @ts-ignore zod 4.x support toJSONSchema
234
+ if (typeof z?.toJSONSchema === 'function') {
235
+ // @ts-ignore
236
+ return z.toJSONSchema(schema, {
237
+ target: 'draft-7',
238
+ });
239
+ }
233
240
  return zodToJsonSchema(schema, { $refStrategy: 'none' });
234
241
  }