Skip to content
This repository was archived by the owner on May 18, 2024. It is now read-only.
This repository was archived by the owner on May 18, 2024. It is now read-only.

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

@shuvamkr

Description

@shuvamkr

`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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions