Skip to content

v1.1.8 ```parse`` cleans up and normalize phone numbers

Latest
Compare
Choose a tag to compare
@HuluWZ HuluWZ released this 31 Aug 07:18
· 1 commit to main since this release
387c417

v1.1.8 parse cleans up and normalize phone numbers

Usage

const {  parse} = require('phone-formater-eth');
  
  Or

import {  parse } from 'phone-formater-eth';

  1. parse - Parse phone number to remove special characters like '-' and '(' ')'
    Parameters - phone (string): The phone number to cleaned.
    Returns - (string): The cleaned phone number if the phone is valid else "INVALID_PHONE_NUMBER"

    Examples

console.log(parse("(251) 911-123-456")); //25191112456
console.log(parse("(251) 911-123-456")); //25191112456
console.log(parse("251-911-123-456"));   //25191112456
console.log(parse("2519-11-123-456"));   //25191112456