forked from catamphetamine/libphonenumber-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.common.js
More file actions
54 lines (43 loc) · 1.37 KB
/
index.common.js
File metadata and controls
54 lines (43 loc) · 1.37 KB
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
53
54
'use strict'
var custom = require('./custom')
var metadata = require('./metadata.min.json')
exports = module.exports = {}
exports.parse = function parse()
{
var parameters = Array.prototype.slice.call(arguments)
parameters.push(metadata)
return custom.parse.apply(this, parameters)
}
exports.format = function format()
{
var parameters = Array.prototype.slice.call(arguments)
parameters.push(metadata)
return custom.format.apply(this, parameters)
}
exports.get_number_type = function get_number_type()
{
var parameters = Array.prototype.slice.call(arguments)
parameters.push(metadata)
return custom.getNumberType.apply(this, parameters)
}
exports.is_valid_number = function is_valid_number()
{
var parameters = Array.prototype.slice.call(arguments)
parameters.push(metadata)
return custom.isValidNumber.apply(this, parameters)
}
exports.as_you_type = function as_you_type(country)
{
custom.asYouType.call(this, country, metadata)
}
exports.as_you_type.prototype = Object.create(custom.asYouType.prototype, {})
exports.as_you_type.prototype.constructor = exports.as_you_type
exports.DIGIT_PLACEHOLDER = custom.DIGIT_PLACEHOLDER
// camelCase aliases
exports.getNumberType = exports.get_number_type
exports.isValidNumber = exports.is_valid_number
exports.asYouType = exports.as_you_type
exports.getPhoneCode = function(country)
{
return custom.getPhoneCode(country, metadata)
}