awesome-phonenumber
Advanced tools
Comparing version 1.4.0 to 1.5.0
14
index.js
@@ -1,1 +0,13 @@ | ||
module.exports = require('./lib').PhoneNumber; | ||
'use strict'; | ||
module.exports = require( './lib' ).PhoneNumber; | ||
Object.defineProperty( | ||
module.exports, | ||
"__esModule", | ||
{ | ||
value: true | ||
} | ||
); | ||
module.exports.default = module.exports; |
@@ -5,3 +5,3 @@ { | ||
"license": "MIT", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"author": "Gustaf Räntilä <g.rantila@gmail.com>", | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -7,3 +7,3 @@ [![npm version][npm-image]][npm-url] | ||
Uses libphonenumber v8.5.0 | ||
Uses libphonenumber v8.7.0 | ||
@@ -68,2 +68,10 @@ [![build status][travis-image]][travis-url] | ||
### Detect country | ||
When constructed with a phone number on `e164` format (i.e. prefixed with a `+`), awesome-phonenumber will auto-detect the country: | ||
```js | ||
PhoneNumber( '+46707123456' ).getRegionCode( ); // -> 'SE' | ||
``` | ||
## API types | ||
@@ -113,3 +121,3 @@ | ||
var PhoneNumber = require( 'awesome-phonenumber' ); | ||
```` | ||
``` | ||
@@ -123,3 +131,3 @@ ### Country codes | ||
PhoneNumber.getRegionCodeForCountryCode( countryCode ); // -> regionCode | ||
```` | ||
``` | ||
@@ -131,4 +139,10 @@ #### Example | ||
PhoneNumber.getRegionCodeForCountryCode( 46 ); // -> 'SE' | ||
```` | ||
``` | ||
### Supported calling codes | ||
```js | ||
PhoneNumber.getSupportedCallingCodes( ); // -> [ calling codes... ] | ||
``` | ||
### Phone numbers | ||
@@ -228,2 +242,2 @@ | ||
[travis-image]: https://img.shields.io/travis/grantila/awesome-phonenumber.svg | ||
[travis-url]: https://travis-ci.org/grantila/awesome-phonenumber | ||
[travis-url]: https://travis-ci.org/grantila/awesome-phonenumber |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
238
244286
1028