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 throw option? #4

Open
sindresorhus opened this issue Jun 26, 2022 · 2 comments
Open

Add throw option? #4

sindresorhus opened this issue Jun 26, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sindresorhus
Copy link
Owner

Some user may want to differentiate when a regex timed out and when it just didn't match. We could add a throw option (better name suggestion welcome!) that makes it throw a RegexTimeout error instead returning an empty value.

@sindresorhus sindresorhus added enhancement New feature or request help wanted Extra attention is needed labels Jun 26, 2022
@Richienb
Copy link
Contributor

With all of these options that could apply to any function, there may be of use to also export a class so that custom default options could be set.

@sindresorhus
Copy link
Owner Author

An alternative is to export separate functions for the throwing variants. Thoughts on that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants