-
Couldn't load subscription status.
- Fork 14
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Current Behavior
https://github.com/ZooTools/email-spell-checker/blob/420dc73a72316848c2bd908c6fb95e4aa9aa0855/src/lib/suggest-email.ts#L90 constructs a regex by string manipulation, which causes an exception if we reach that line with a domain that contains invalid regex syntax.
Expected Behavior
Calling with any input should either suggest an email or fail cleanly (returning undefined), not throw an exception.
Steps to Reproduce the Problem
> const suggestedEmail4 = emailSpellChecker.run({
... email: 'jorge@bigidaunashtnsuaeonsti.co)',
... })
Uncaught SyntaxError: Invalid regular expression: /co)$/: Unmatched ')'
Environment
- Version: 1.12.0
- Platform: Linux
- Node.js Version: v18.19.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working