saudi-id-validator
v1.0.6
Published
A tiny package that helps you validate Saudi national and iqama id
Downloads
637
Maintainers
Readme
saudi-id-validator
A tiny package that helps you validate Saudi national or iqama ids. Inspired by the original repo Saudi-ID-Validator so special thanks to them!
Features
:white_check_mark: Supports Typescript :white_check_mark: Accepts number or string :white_check_mark: Accepts both eastern and western Arabic numbers
Installation
To install the package run:
npm i saudi-id-validator
or
yarn add saudi-id-validator
Usage
Here's a basic example on how you can use the package:
import { isValidSaudiID } from "saudi-id-validator"
console.log(isValidSaudiID("1000000008")) // => true if this's your id please don't sue me :)
console.log(isValidSaudiID(1000000008)) // => true
console.log(isValidSaudiID("١٠٠٠٠٠٠٠٠٨")) // => true
console.log(isValidSaudiID("1000000000")) // => false
console.log(isValidSaudiID("100000000")) // => false
console.log(isValidSaudiID("not a number")) // => false