Skip to content

Commit

Permalink
Change email regex to new one from Zod #180
Browse files Browse the repository at this point in the history
Co-authored-by: Macs Dickinson <[email protected]>
  • Loading branch information
fabian-hiller and MacsDickinson committed Oct 6, 2023
1 parent 3693a45 commit 8bf2e93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/src/validations/email/email.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { getOutput, getPipeIssues } from '../../utils/index.ts';
*/
export function email<TInput extends string>(error?: ErrorMessage) {
return (input: TInput): PipeResult<TInput> =>
!/^([A-Z0-9_+-]+\.?)*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i.test(
!/^(?!\.)(?!.*\.\.)([A-Z0-9_+-.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i.test(
input
)
? getPipeIssues('email', error || 'Invalid email', input)
Expand Down

0 comments on commit 8bf2e93

Please sign in to comment.