checkProvince(id)
Verify whether the province code of an ID number is valid.
Signature
typescript
function checkProvince(id: string): booleanParameters
| Parameter | Type | Description |
|---|---|---|
| id | string | ID number |
Returns
Returns true if the province code is valid, false otherwise.
Live Demo
Example
typescript
import { checkProvince } from 'china-id-card'
checkProvince('622922197808118498') // → true (Gansu Province)
checkProvince('999922197808118498') // → false