Skip to content
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

A validator class to expose method to validate various numbers such as Mobile, PAN, UPI id #121

Open
shuvamkr mannequin opened this issue Sep 26, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@shuvamkr
Copy link
Mannequin

shuvamkr mannequin commented Sep 26, 2022

`export class Validator {
static mobile(value: string): boolean {
return /^[6789]\d{9}$/.test(value);
}

static pincode(value: string | number): boolean {
return /^[1-9]\d{5}$/.test(value as string);
}

static pan(value: string): boolean {
return /^[A-Z]{3}[PCHABGJLFTE][A-Z]\d{4}[A-Z]$/i.test(value);
}

}`

Something like this, found on Github

@shuvamkr shuvamkr mannequin self-assigned this Sep 26, 2022
@shuvamkr shuvamkr mannequin added enhancement New feature or request good first issue Good for newcomers labels Sep 26, 2022
@vikaz-singh vikaz-singh mannequin removed the good first issue Good for newcomers label Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

0 participants