hack-dance / island-ai

https://island.novy.work
MIT License
125 stars 11 forks source link

add support for zod default values #12

Closed roodboi closed 9 months ago

roodboi commented 9 months ago

adding support for zod .default()

const schema = z.object({ someString: z.string().default("default string"), someNumber: z.number().default(420), someBoolean: z.boolean().default(true) })

parsing with this schema and returning an empty obj will now return ->

{ someString: "default string", someNumber: 420, someBoolean: true, }

changeset-bot[bot] commented 9 months ago

🦋 Changeset detected

Latest commit: 7f3c867b07afdcb24113a83887e01d715847e15d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------- | ----- | | schema-stream | Minor |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 9 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
island-ai-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 21, 2024 11:21pm