Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@code-ts/cin

code-ts20MIT0.0.3TypeScript support: included

Utils about citizen identification number | 公民身份证号码工具方法

code-ts, cin, id-card, parse, validate, 身份证号码, 解析, 校验

readme

@code-ts/cin

Utils about citizen identification number | 公民身份证号码工具方法.

Install

npm i @code-ts/cin
yarn add @code-ts/cin
pnpm add @code-ts/cin

Usage

import { validateCIN } from '@code-ts/cin'

validateCIN('110101199003076878') // true

API

validateCIN

Check if the given code match the CIN pattern.

Type definition:

function validateCIN(code: string): boolean

Credits

License

MIT License © 2023-PRESENT ntnyq