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

feat(schema): added strong optional typing #3474

Merged
merged 1 commit into from
Jan 6, 2025

Conversation

0xcadams
Copy link
Contributor

@0xcadams 0xcadams commented Jan 6, 2025

This adds strong typing to the optional property passed into e.g. column.string(false), instead of optional: boolean

const _demo = string(false)
//     ^ { type: 'string', optional: false, customType: string }

const _demo2 = string()
//     ^ { type: 'string', optional: false, customType: string }

const _demo3 = string(true)
//     ^ { type: 'string', optional: true, customType: string }

Copy link

vercel bot commented Jan 6, 2025

@0xcadams is attempting to deploy a commit to the Rocicorp Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@arv arv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you. Much nicer

Copy link

vercel bot commented Jan 6, 2025

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

Name Status Preview Comments Updated (UTC)
replicache-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 6, 2025 11:19am
zbugs ✅ Ready (Inspect) Visit Preview Jan 6, 2025 11:19am

@arv
Copy link
Contributor

arv commented Jan 6, 2025

FYI, these things can be "unit" tested but no need at this point.

@arv arv merged commit a912cad into rocicorp:main Jan 6, 2025
9 checks passed
@0xcadams 0xcadams deleted the optional-typed branch January 6, 2025 16:04
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.

2 participants