Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dtgoitia/format-phone
https://github.com/dtgoitia/format-phone
Last synced: 25 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dtgoitia/format-phone
- Owner: dtgoitia
- Created: 2018-02-01T04:27:28.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-02-02T12:36:30.000Z (almost 7 years ago)
- Last Synced: 2024-10-28T13:55:32.716Z (2 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Phone formater
This package contains a single function (`formatPhone`) which takes a phone number and returns it propperly formated.
`formatPhone(phone)`:
* `phone` (string) - phone number to be formated
* returns (string) - phone number formatedSupported phone formats:
* Spain
* United KingdomIf a phone number is not supported/recognised, it will be returned without any change.
## How to contribute
**Requirements**
Ensure you have Node.js and NPM installed.**Install packages**
Install required NPM packages:
```bash
npm install
```**Test code**
To run the test suit against the code:
```bash
npm test
```
The above command will:
1. Remove the `/build` directory.
2. Run `tsc` to transpile TypeScript code within `/src` and `/test` directories into JavaScript and store it into `/build/src` and `/build/test` respectivelly.
3. Execute the test file within `/build/test/Test.js`.