Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

myanmar-phone-number-validator-ts

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

myanmar-phone-number-validator-ts

A TypeScript library to validate and extract information from Myanmar phone numbers.

  • 1.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Myanmar Phone Number Validator

A TypeScript library to validate and extract information from Myanmar phone numbers. It is based on the original JavaScript library created by Kaung Myat Lwin, which has been adapted and enhanced to support TypeScript.

Installation

To install the package, run:

npm i myanmar-phone-number-validator-ts

Usage

The package exports a myanmarPhoneNumber object with the following functions:

isValidMMPhoneNumber(phoneNumber: string): boolean

Returns true if the input string is a valid Myanmar phone number, false otherwise.

import {myanmarPhoneNumber} from 'myanmar-phone-number-validator';

const phoneNumber = '0949880111';
if (myanmarPhoneNumber.isValidMMPhoneNumber(phoneNumber)) {
    // Valid phone number
} else {
    // Invalid phone number
}

getTelecomName(phoneNumber: string): string

Returns the name of the telecom operator for the given phone number, or "Unknown" if the operator cannot be determined.

import {myanmarPhoneNumber} from 'myanmar-phone-number-validator';

const phoneNumber = '0949880111';
const telecomName = myanmarPhoneNumber.getTelecomName(phoneNumber);

getPhoneNetworkType(phoneNumber: string): string

Returns the network type of the given phone number, or "Unknown" if the network type cannot be determined.

import {myanmarPhoneNumber} from 'myanmar-phone-number-validator';

const phoneNumber = '0949880111';
const networkType = myanmarPhoneNumber.getPhoneNetworkType(phoneNumber);

License

This project is licensed under the MIT License.

Credit

This library is based on the original JavaScript library created by Kaung Myat Lwin. Thank you for your contribution bro!

Keywords

FAQs

Package last updated on 06 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc