Package Exports
- nigerian-phone-number-validator
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nigerian-phone-number-validator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
nigerian-phone-number-validator
Small utility for validating and sanitizing nigerian phone numbers
Installation
$ npm install --save nigerian-phone-number-validator
Usage
import { verifyPhoneNumber, sanitizePhoneNumber, COUNTRY_CODE } from "nigerian-phone-number-validator"
or
const { verifyPhoneNumber, sanitizePhoneNumber, COUNTRY_CODE } = require("nigerian-phone-number-validator")
verifyPhoneNumber("2348139922348")); // true
verifyPhoneNumber("08139922348")); // true
verifyPhoneNumber("081399223482"); // false
verifyPhoneNumber("245475693092"); // false
sanitizePhoneNumber("08139922348"); // 2348139922348 (Default Sanitize Mode is throwInvalid)
sanitizePhoneNumber("08139922348", , { mode : "passthrough" | "throwInvalid" }); // 2348139922348
Testing
$ npm test