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: add parse() and format() exports #213

Merged
merged 3 commits into from Mar 19, 2024
Merged

Conversation

styfle
Copy link
Member

@styfle styfle commented Mar 18, 2024

This PR exports parse() and format() functions which makes it much easier to work with arbitrary input from users.

For example, onChange(e => ms.parse(e.target.value)) no longer needs to type cast since parse() accepts a string.

I also added parseStrict() for the case when you want the type safety and you're using a literal.

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
@styfle styfle requested a review from mrmckeb March 18, 2024 23:40
@styfle styfle merged commit f150c1c into master Mar 19, 2024
6 checks passed
@styfle styfle deleted the split-parse-format-funcs branch March 19, 2024 20:52
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.

None yet

2 participants