Skip to content

feat(isIdentityCard): add KR(South Korea) locale in validators #2558

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

SHINDongHyeo
Copy link

@SHINDongHyeo SHINDongHyeo commented Apr 30, 2025

isIdentityCard.js

This PR adds a validator for South Korean national identification numbers (주민등록번호, 주민번호).

A South Korean ID number has the format YYMMDD-GXXXXXX:

  • YYMMDD: date of birth
  • G: gender and century indicator
    • 1 or 2 = born 1900–1999
    • 3 or 4 = born 2000–2099
  • The remaining 6 digits (XXXXXX) are random codes.

This validator checks:

  • valid date format (YYMMDD)
  • correct grouping format with optional hyphen
  • valid G digit based on birth year

Checklist

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

Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d91af4b) to head (9f91515).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #2558   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          114       114           
  Lines         2535      2543    +8     
  Branches       641       642    +1     
=========================================
+ Hits          2535      2543    +8     

☔ 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