Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for zod default values #12

Merged
merged 4 commits into from
Jan 22, 2024
Merged

add support for zod default values #12

merged 4 commits into from
Jan 22, 2024

Conversation

roodboi
Copy link
Contributor

@roodboi roodboi commented Jan 21, 2024

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,
}

Copy link

changeset-bot bot commented Jan 21, 2024

🦋 Changeset detected

Latest commit: 7f3c867

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

Copy link

vercel bot commented Jan 21, 2024

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

@roodboi roodboi merged commit 4024931 into main Jan 22, 2024
3 checks passed
@roodboi roodboi deleted the support-default-values branch January 22, 2024 01:08
@github-actions github-actions bot mentioned this pull request Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant