-
-
Notifications
You must be signed in to change notification settings - Fork 272
feat: add stringbool
action
#1251
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new stringbool
action that converts string values to boolean values based on configurable truthy and falsy string lists. The implementation is inspired by Zod's string-to-boolean coercion functionality and provides case-sensitive/insensitive matching options.
- Implements string-to-boolean transformation with customizable truthy/falsy values
- Provides case sensitivity control with default insensitive matching
- Includes comprehensive test coverage for all configuration options
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
File | Description |
---|---|
library/src/actions/stringbool/stringbool.ts | Core implementation of the stringbool action with options interface and transformation logic |
library/src/actions/stringbool/stringbool.test.ts | Comprehensive test suite covering default options, custom configurations, and error cases |
library/src/actions/stringbool/stringbool.test-d.ts | TypeScript type tests ensuring correct type inference for inputs, outputs, and issues |
library/src/actions/stringbool/index.ts | Export module for the stringbool action |
library/src/actions/index.ts | Adds stringbool to the main actions export |
website/src/routes/api/menu.md | Updates API documentation menu to include stringbool entries |
website/src/routes/api/(actions)/stringbool/index.mdx | API documentation for the stringbool action with usage examples |
website/src/routes/api/(types)/StringboolAction/index.mdx | Documentation for the StringboolAction type interface |
website/src/routes/api/(types)/StringboolIssue/index.mdx | Documentation for the StringboolIssue type interface |
website/src/routes/api/(types)/StringboolOptions/index.mdx | Documentation for the StringboolOptions type interface |
commit: |
Resolves #1240
Reference
Mostly inspired by Zod’s implementation:
Also referenced the upcoming Valibot actions:
Open Questions
Should it be named
stringbool
?toSomething
Should it accept a
message
?Do we have integration tests between a schema and an action?
v.string()
currently)