@basichelpers/replace
v0.0.3
Published
```bash npm install @basichelpers/replace ```
Downloads
5
Readme
Install the dependencies
npm install @basichelpers/replace
how to use
import { onlyNumbers, phoneNumber } from '@basichelpers/replace'
/**
* @return {number} 9012341234
*/
onlyNumbers('090-1234-1234')
/**
* @return {string} '09012341234'
*/
onlyNumbers('090-1234-1234', false)
/**
* @default ['+81']
*/
phoneInit(['+1', '+44', '+81', ...'+998'])
/**
* @param {string | number} '090-1234-1234' | 9012341234
* @return {string} '+819012341234'
*/
phoneNumber('090-1234-1234')
phoneNumber(9012341234)
/**
* @param {string | number} '090-1234-1234' | 9012341234
* @param {string} '+44'
* @return {string} '+449012341234'
*/
phoneNumber('090-1234-1234', '+44')
/**
* @param {string | number} '090-1234-1234' | 9012341234
* @param {string} '+44'
* @param {array} ['+44', '+81']
* @return {string} '+449012341234'
*/
phoneNumber('090-1234-1234', '+44', ['+44', '+81'])