npm.io
1.0.6 • Published 4 years ago

phn-validator

Licence
MIT
Version
1.0.6
Deps
0
Size
6 kB
Vulns
0
Weekly
0
Stars
2

PHN Validator

This package provides a simple validator for British Columbia provincial health numbers. The validation follows the process on page 23 of this document

Installation

Install my-project with npm

  npm i phn-validator

Or yarn

  yarn add phn-validator

Usage/Examples

import { phnValidator } from 'phn-validator';

phnValidator("123"); // false
phnValidator("0123456789"); // false
phnValidator("apple"); // Error: Input value must be a numeric string
phnValidator(1001); // Error: Input value must be a string
phnValidator("9260784079"); // true

Keywords