vietnam-phone
v1.0.6
Published
Detect Vietnam Phone Number
Downloads
53
Maintainers
Readme
vietnam-phone
Detect vietnam phonenumber, support new province code.
Installation
npm install vietnam-phone --save
or
yarn add vietnam-phone
API
detectPhoneNumber(phone_number: string)
: Responsephone_number
: Stringold_number
: String, Old phone number using old province codenew_number
: String, New phone number using new province codeis_change
: Boolean, Status check phone number old phone or new phonevendor
: String, {VIETTEL
,VINAPHONE
,MOBIFONE
,VIETNAMOBILE
,BEELINE
}
Usage
import { detectPhoneNumber } from 'vietnam-phone';
console.log(detectPhoneNumber('01693234345'));
# Response
# {phone_number: "01693234345", old_number: "01693234345", new_number: "0393234345", is_change: true, vendor: "VIETTEL"}
console.log(detectPhoneNumber('0393234345'));
# Response
# {phone_number: "0393234345", old_number: "01693234345", new_number: "0393234345", is_change: true, vendor: "VIETTEL"}