iranian-validation
v0.4.1
Published
type script validation for iranian
Downloads
149
Readme
Installation
- Clone the repo
- Run npm/yarn install
npm install iranian-validation
carPlate phone mobile nationaCode shebaCode persianNumber notPersianNumber jalaliDate persianAlphabet bankCart postalCode iranBusinessNationalCode
Change Log
Contributing
Author
Hooshyar ghaderi
License
How use
import { validateOrReject } from "class-validator";
import { IsIranianMobile } from "iranian-validation";
class User {
@IsIranianMobile()
mobile: string;
}
const user = new User();
user.mobile = "09122222222";
validateOrRejectExample(user);
async function validateOrRejectExample(input) {
try {
await validateOrReject(input);
} catch (errors) {
console.error(errors);
}
}