Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(isPassportNumber): fix regex for CN#1714

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
profnandaa merged 2 commits intovalidatorjs:masterfromanirudhgiri:master
Sep 26, 2021

Conversation

anirudhgiri
Copy link
Contributor

Fixes#1686

The format for passport numbers for CN passports are as follows:

  • Starts with either a "G" (for Ordinary) or an "E" (for Electronic)
  • If it starts with "G", 8 numbers follow
  • If it starts with "E" either 8 numbers follow, or a letter [A-Z] (except "I" or "O") and 7 numbers follow

Valid Examples:

  • G12345678
  • E12345678
  • EA1234567

So the above conditions were implemented with the following regex :^G\d{8}$|^E(?![IO])[A-Z0-9]\d{7}$

The appropriate testes were added to validators.js with all of them passing.

Checklist

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

@codecov
Copy link

codecovbot commentedAug 20, 2021

Codecov Report

Merging#1714 (606c8cd) intomaster (8c4b3b3) willnot change coverage.
The diff coverage isn/a.

Impacted file tree graph

@@            Coverage Diff            @@##            master     #1714   +/-   ##=========================================  Coverage   100.00%   100.00%           =========================================  Files          101       101             Lines         2005      2005             Branches       452       452           =========================================  Hits          2005      2005
Impacted FilesCoverage Δ
src/lib/isPassportNumber.js100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last update8c4b3b3...606c8cd. Read thecomment docs.

@anirudhgiri
Copy link
ContributorAuthor

Bump!
It's been 48 hours since I opened the PR and no one has reviewed it. Just making sure 😄

Copy link
Member

@tux-tntux-tn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Really sorry for the long delay@anirudhgiri ! Thank you for your PR 🎉
LGTM !

@tux-tntux-tn added ready-to-landFor PRs that are reviewed and ready to be landed 🎉 first-pr labelsSep 20, 2021
Copy link
Member

@profnandaaprofnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

LGTM, thanks for your contrib! 🎉

@profnandaaprofnandaa merged commit69881b6 intovalidatorjs:masterSep 26, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@profnandaaprofnandaaprofnandaa approved these changes

@tux-tntux-tntux-tn approved these changes

Assignees

No one assigned

Labels

🎉 first-prready-to-landFor PRs that are reviewed and ready to be landed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

isPassportNumber isnot exactlly

3 participants

@anirudhgiri@profnandaa@tux-tn

[8]ページ先頭

©2009-2025 Movatter.jp