-
Notifications
You must be signed in to change notification settings - Fork 55
/
index.js
52 lines (48 loc) · 1.32 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
const exportedName = 'PhoneNumber$$module$src$index';
module.exports =
require( './lib' )[ exportedName ] ||
(
typeof globalThis !== 'undefined' && globalThis
|| typeof global !== 'undefined' && global
|| typeof window !== 'undefined' && window
|| typeof self !== 'undefined' && self
|| this
)[ exportedName ];
Object.defineProperty(
module.exports,
"__esModule",
{
value: true
}
);
module.exports.parsePhoneNumber = ( ...args ) =>
{
try
{
const ret = module.exports( ...args ).toJSON( );
if ( !ret.valid && !ret.possible )
{
ret.possible = false;
if ( !ret.possibility )
ret.possibility = 'invalid';
}
return ret;
}
catch ( error )
{
return {
valid: false,
possible: false,
possibility: 'invalid',
error,
};
}
};
module.exports.getCountryCodeForRegionCode = module.exports.getCountryCodeForRegionCode;
module.exports.getRegionCodeForCountryCode = module.exports.getRegionCodeForCountryCode;
module.exports.getSupportedCallingCodes = module.exports.getSupportedCallingCodes;
module.exports.getSupportedRegionCodes = module.exports.getSupportedRegionCodes;
module.exports.getExample = module.exports.getExample;
module.exports.getAsYouType = module.exports.getAsYouType;
module.exports.getNumberFrom = module.exports.getNumberFrom;
module.exports.findNumbers = module.exports.findNumbers;