Skip to content

Conversation

@darkwingpatil
Copy link

@darkwingpatil darkwingpatil commented Dec 30, 2025

Summary

Added a new allow_zero_width option to the isEmail validator to detect and reject email addresses containing zero-width characters (U+200B-U+200D, U+FEFF).

Changes

  • Added allow_zero_width option to isEmail validator (defaults to true for backward compatibility)
  • Implemented regex pattern to detect zero-width characters: [\u200B-\u200D\uFEFF]
  • Validation checks both the user part and domain part of email addresses
  • Updated README.md documentation to reflect the new option

Motivation

Zero-width characters (invisible Unicode characters) can be used in phishing attacks and to create confusingly similar email addresses. This option allows developers to enable stricter email validation when needed by setting allow_zero_width: false.

Checklist

  • PR contains only changes related; no stray files, etc.
  • README updated (where applicable)
  • Tests written (where applicable)
  • References provided in PR (where applicable)

@codecov
Copy link

codecov bot commented Dec 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (784e52a) to head (581e7de).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2648   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2572      2576    +4     
  Branches       651       653    +2     
=========================================
+ Hits          2572      2576    +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

1 participant