-
Notifications
You must be signed in to change notification settings - Fork 11
/
GeolocationParams.js
executable file
·100 lines (78 loc) · 1.96 KB
/
GeolocationParams.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
module.exports = class GeolocationParams {
constructor() {
var ipAdress = '';
var ipAdresses = [];
var fields = '*';
var excludes = '';
var lang = 'en';
var includeHostname = false;
var includeLiveHostname = false;
var includeHostnameFallbackLive = false;
var includeSecurity = false;
var includeUserAgent = false;
}
setIPAddress(ipAddress = '') {
this.ipAdress = ipAddress;
}
getIPAddress() {
return this.ipAdress;
}
setFields(fields = '*') {
this.fields = fields;
}
getFields() {
return this.fields;
}
setExcludes(excludes = '') {
this.excludes = excludes;
}
getExcludes() {
return this.excludes;
}
setLang(lang = 'en') {
this.lang = lang;
}
getLang() {
return this.lang;
}
setIPAddresses(ipAdresses = []) {
if (ipAdresses.length > 50) {
console.log("Max. number of IP addresses cannot be more than 50.");
} else {
this.ipAdresses = ipAdresses;
}
}
getIPAddresses() {
return this.ipAdresses;
}
setIncludeHostname(b = false) {
this.includeHostname = b;
}
setIncludeHostnameFallbackLive(b = false) {
this.includeHostnameFallbackLive = b;
}
setIncludeLiveHostname(b = false) {
this.includeLiveHostname = b;
}
setIncludeSecurity(b = false) {
this.includeSecurity = b;
}
setIncludeUserAgent(b = false) {
this.includeUserAgent = b;
}
isIncludeHostname() {
return this.includeHostname;
}
isIncludeHostnameFallbackLive() {
return this.includeHostnameFallbackLive;
}
isIncludeLiveHostname() {
return this.includeLiveHostname;
}
isIncludeSecurity() {
return this.includeSecurity;
}
isIncludeUserAgent() {
return this.includeUserAgent;
}
}