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 Schema.BooleanFromUnknown #2453

Merged
merged 5 commits into from
Apr 2, 2024

Conversation

jessekelly881
Copy link
Contributor

@jessekelly881 jessekelly881 commented Mar 31, 2024

Adds a BooleanFromUnknown schema that uses isTruthy (i.e. !!val) to convert an unknown to a boolean. A kind of fuzzy boolean.

Zod also has boolean coercion. https://github.com/colinhacks/zod?tab=readme-ov-file#coercion-for-primitives

Copy link

changeset-bot bot commented Mar 31, 2024

🦋 Changeset detected

Latest commit: 1987960

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

This PR includes changesets to release 10 packages
Name Type
@effect/schema Patch
@effect/cli Patch
@effect/experimental Patch
@effect/platform-browser Patch
@effect/platform-bun Patch
@effect/platform-node-shared Patch
@effect/platform-node Patch
@effect/platform Patch
@effect/rpc-http Patch
@effect/rpc Patch

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

@jessekelly881 jessekelly881 changed the title Add Schema.Truthy Add Schema.BooleanFromUnknown Mar 31, 2024
@gcanti gcanti added the schema label Apr 2, 2024
@gcanti gcanti merged commit 7cc2b41 into Effect-TS:main Apr 2, 2024
12 checks passed
@github-actions github-actions bot mentioned this pull request Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants