libphonenumber-js 1.10.5 → 1.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/libphonenumber-js.min.js.map +1 -1
- package/bundle/libphonenumber-max.js.map +1 -1
- package/bundle/libphonenumber-min.js.map +1 -1
- package/bundle/libphonenumber-mobile.js.map +1 -1
- package/index.cjs +9 -9
- package/index.cjs.js +9 -9
- package/index.es6.exports/PhoneNumberSearch.js +3 -1
- package/index.es6.exports/findPhoneNumbers.js +2 -2
- package/index.es6.exports/format.js +2 -2
- package/index.es6.exports/getNumberType.js +2 -2
- package/index.es6.exports/isPossibleNumber.js +2 -2
- package/index.es6.exports/isValidNumber.js +2 -2
- package/index.es6.exports/isValidNumberForRegion.js +2 -2
- package/index.es6.exports/parse.js +2 -2
- package/index.es6.exports/searchPhoneNumbers.js +2 -2
- package/max/exports/AsYouType.js +4 -1
- package/max/exports/Metadata.js +4 -1
- package/max/exports/PhoneNumberMatcher.js +4 -1
- package/max/exports/findNumbers.js +2 -2
- package/max/exports/findPhoneNumbersInText.js +2 -2
- package/max/exports/formatIncompletePhoneNumber.js +2 -2
- package/max/exports/getCountries.js +2 -2
- package/max/exports/getCountryCallingCode.js +2 -2
- package/max/exports/getExampleNumber.js +2 -2
- package/max/exports/getExtPrefix.js +2 -2
- package/max/exports/isPossiblePhoneNumber.js +2 -2
- package/max/exports/isSupportedCountry.js +2 -2
- package/max/exports/isValidPhoneNumber.js +2 -2
- package/max/exports/parsePhoneNumberFromString.js +2 -2
- package/max/exports/parsePhoneNumberWithError.js +2 -2
- package/max/exports/searchNumbers.js +2 -2
- package/max/exports/searchPhoneNumbersInText.js +2 -2
- package/max/exports/validatePhoneNumberLength.js +2 -2
- package/max/exports/withMetadataArgument.js +9 -0
- package/min/exports/AsYouType.js +4 -1
- package/min/exports/Metadata.js +4 -1
- package/min/exports/PhoneNumberMatcher.js +4 -1
- package/min/exports/findNumbers.js +2 -2
- package/min/exports/findPhoneNumbersInText.js +2 -2
- package/min/exports/formatIncompletePhoneNumber.js +2 -2
- package/min/exports/getCountries.js +2 -2
- package/min/exports/getCountryCallingCode.js +2 -2
- package/min/exports/getExampleNumber.js +2 -2
- package/min/exports/getExtPrefix.js +2 -2
- package/min/exports/isPossiblePhoneNumber.js +2 -2
- package/min/exports/isSupportedCountry.js +2 -2
- package/min/exports/isValidPhoneNumber.js +2 -2
- package/min/exports/parsePhoneNumberFromString.js +2 -2
- package/min/exports/parsePhoneNumberWithError.js +2 -2
- package/min/exports/searchNumbers.js +2 -2
- package/min/exports/searchPhoneNumbersInText.js +2 -2
- package/min/exports/validatePhoneNumberLength.js +2 -2
- package/min/exports/withMetadataArgument.js +9 -0
- package/mobile/exports/AsYouType.js +4 -1
- package/mobile/exports/Metadata.js +4 -1
- package/mobile/exports/PhoneNumberMatcher.js +4 -1
- package/mobile/exports/findNumbers.js +2 -2
- package/mobile/exports/findPhoneNumbersInText.js +2 -2
- package/mobile/exports/formatIncompletePhoneNumber.js +2 -2
- package/mobile/exports/getCountries.js +2 -2
- package/mobile/exports/getCountryCallingCode.js +2 -2
- package/mobile/exports/getExampleNumber.js +2 -2
- package/mobile/exports/getExtPrefix.js +2 -2
- package/mobile/exports/isPossiblePhoneNumber.js +2 -2
- package/mobile/exports/isSupportedCountry.js +2 -2
- package/mobile/exports/isValidPhoneNumber.js +2 -2
- package/mobile/exports/parsePhoneNumberFromString.js +2 -2
- package/mobile/exports/parsePhoneNumberWithError.js +2 -2
- package/mobile/exports/searchNumbers.js +2 -2
- package/mobile/exports/searchPhoneNumbersInText.js +2 -2
- package/mobile/exports/validatePhoneNumberLength.js +2 -2
- package/mobile/exports/withMetadataArgument.js +9 -0
- package/package.json +1 -1
- package/max/metadata.js +0 -11
- package/min/metadata.js +0 -11
- package/mobile/metadata.js +0 -11
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
2
|
+
// importing system which is even uncapable of importing "*.json" files.
|
|
3
|
+
import metadata from '../../metadata.min.json.js'
|
|
4
|
+
|
|
5
|
+
export default function withMetadataArgument(func, _arguments) {
|
|
6
|
+
var args = Array.prototype.slice.call(_arguments)
|
|
7
|
+
args.push(metadata)
|
|
8
|
+
return func.apply(this, args)
|
|
9
|
+
}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
2
|
+
// importing system which is even uncapable of importing "*.json" files.
|
|
3
|
+
import metadata from '../../metadata.mobile.json.js'
|
|
4
|
+
|
|
2
5
|
import { AsYouType as _AsYouType } from '../../core/index.js'
|
|
3
6
|
|
|
4
7
|
export function AsYouType(country) {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
2
|
+
// importing system which is even uncapable of importing "*.json" files.
|
|
3
|
+
import metadata from '../../metadata.mobile.json.js'
|
|
4
|
+
|
|
2
5
|
import { Metadata as _Metadata } from '../../core/index.js'
|
|
3
6
|
|
|
4
7
|
export function Metadata() {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
2
|
+
// importing system which is even uncapable of importing "*.json" files.
|
|
3
|
+
import metadata from '../../metadata.mobile.json.js'
|
|
4
|
+
|
|
2
5
|
import { PhoneNumberMatcher as _PhoneNumberMatcher } from '../../core/index.js'
|
|
3
6
|
|
|
4
7
|
export function PhoneNumberMatcher(text, options) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { findNumbers as _findNumbers } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function findNumbers() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_findNumbers, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { findPhoneNumbersInText as _findPhoneNumbersInText } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function findPhoneNumbersInText() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_findPhoneNumbersInText, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { formatIncompletePhoneNumber as _formatIncompletePhoneNumber } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function formatIncompletePhoneNumber() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_formatIncompletePhoneNumber, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { getCountries as _getCountries } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function getCountries() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_getCountries, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { getCountryCallingCode as _getCountryCallingCode } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function getCountryCallingCode() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_getCountryCallingCode, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { getExampleNumber as _getExampleNumber } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function getExampleNumber() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_getExampleNumber, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { getExtPrefix as _getExtPrefix } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function getExtPrefix() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_getExtPrefix, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { isPossiblePhoneNumber as _isPossiblePhoneNumber } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function isPossiblePhoneNumber() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_isPossiblePhoneNumber, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { isSupportedCountry as _isSupportedCountry } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function isSupportedCountry() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_isSupportedCountry, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { isValidPhoneNumber as _isValidPhoneNumber } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function isValidPhoneNumber() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_isValidPhoneNumber, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { parsePhoneNumberFromString as _parsePhoneNumberFromString } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function parsePhoneNumberFromString() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_parsePhoneNumberFromString, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { parsePhoneNumberWithError as _parsePhoneNumberWithError } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function parsePhoneNumberWithError() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_parsePhoneNumberWithError, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { searchNumbers as _searchNumbers } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function searchNumbers() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_searchNumbers, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { searchPhoneNumbersInText as _searchPhoneNumbersInText } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function searchPhoneNumbersInText() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_searchPhoneNumbersInText, arguments)
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import withMetadataArgument from './withMetadataArgument.js'
|
|
2
2
|
import { validatePhoneNumberLength as _validatePhoneNumberLength } from '../../core/index.js'
|
|
3
3
|
|
|
4
4
|
export function validatePhoneNumberLength() {
|
|
5
|
-
return
|
|
5
|
+
return withMetadataArgument(_validatePhoneNumberLength, arguments)
|
|
6
6
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Importing from a ".js" file is a workaround for Node.js "ES Modules"
|
|
2
|
+
// importing system which is even uncapable of importing "*.json" files.
|
|
3
|
+
import metadata from '../../metadata.mobile.json.js'
|
|
4
|
+
|
|
5
|
+
export default function withMetadataArgument(func, _arguments) {
|
|
6
|
+
var args = Array.prototype.slice.call(_arguments)
|
|
7
|
+
args.push(metadata)
|
|
8
|
+
return func.apply(this, args)
|
|
9
|
+
}
|
package/package.json
CHANGED
package/max/metadata.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Importing from `.json.js` a workaround for a bug in web browsers' "native"
|
|
2
|
-
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
3
|
-
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
4
|
-
import metadata from '../metadata.max.json.js'
|
|
5
|
-
export default metadata
|
|
6
|
-
|
|
7
|
-
export function withMetadata(func, _arguments) {
|
|
8
|
-
var args = Array.prototype.slice.call(_arguments)
|
|
9
|
-
args.push(metadata)
|
|
10
|
-
return func.apply(this, args)
|
|
11
|
-
}
|
package/min/metadata.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Importing from `.json.js` a workaround for a bug in web browsers' "native"
|
|
2
|
-
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
3
|
-
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
4
|
-
import metadata from '../metadata.min.json.js'
|
|
5
|
-
export default metadata
|
|
6
|
-
|
|
7
|
-
export function withMetadata(func, _arguments) {
|
|
8
|
-
var args = Array.prototype.slice.call(_arguments)
|
|
9
|
-
args.push(metadata)
|
|
10
|
-
return func.apply(this, args)
|
|
11
|
-
}
|
package/mobile/metadata.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// Importing from `.json.js` a workaround for a bug in web browsers' "native"
|
|
2
|
-
// ES6 importing system which is uncapable of importing "*.json" files.
|
|
3
|
-
// https://github.com/catamphetamine/libphonenumber-js/issues/239
|
|
4
|
-
import metadata from '../metadata.mobile.json.js'
|
|
5
|
-
export default metadata
|
|
6
|
-
|
|
7
|
-
export function withMetadata(func, _arguments) {
|
|
8
|
-
var args = Array.prototype.slice.call(_arguments)
|
|
9
|
-
args.push(metadata)
|
|
10
|
-
return func.apply(this, args)
|
|
11
|
-
}
|