persianform
v1.6.2
Published
Simple functions for validating persian forms
Downloads
30
Keywords
Readme
what is this?
Validate persian forms just with simple function!
installation
npm i persianform --save
yarn add persianform
Then..
import * as persianForm from 'persianform'
//or
import { isPostalCode, ... } from 'persianform'
<!-- simple options -->
persianForm.isMobilePhone(str) //return true or false
persianForm.isHomePhone(str) //return true or false
persianForm.isPostalCode(str) //return true or false
persianForm.isGpa(str) //return true or false
persianForm.isNationalCode(str) //return true or false
persianForm.isSheba(str) //return true or false
persianForm.isCardNumber(str) //return true or false
persianForm.getBankNameFromCardNumber(str) //return bank name as String
persianForm.getPlaceByNationalCode(str) //return born place as String
persianForm.isEmail(str) //return true or false
persianForm.isValidFile(file) //return true or false
<!-- with options -->
persianForm.isPersian(str, {isNumber: Boolean}) //return true or false
persianForm.isEnglish(str, {isNumber: Boolean}) //return true or false
persianForm.isPassword(str) //return true or false
persianForm.isDuplicate(str, {maxDuplicate: Number}) //return true or false
persianForm.isAddress(str, {maxNumber: Number}) //return true or false
option
- isPersian & isEnglish isNumber (accept number or not) - true | false(Defaults to true)
- isAddress maxNumber (maximum count of numbers)-Number(Defaults to 3)
- isDuplicate maxDuplicate (maximum count of chars repeat)-Number(Defaults to 3)