/
Isp.ts
36 lines (34 loc) · 1.07 KB
/
Isp.ts
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
import mmdb = require('maxmind');
import Asn from './Asn';
export default class Isp extends Asn {
/**
* The name of the ISP associated with the IP address.
*/
public readonly isp: string;
/**
* The mobile country code (MCC) associated with the IP address and ISP.
* See https://en.wikipedia.org/wiki/Mobile_country_code.
*/
public readonly mobileCountryCode?: string;
/**
* The mobile network code (MNC) associated with the IP address and ISP.
* See https://en.wikipedia.org/wiki/Mobile_country_code.
*/
public readonly mobileNetworkCode?: string;
/**
* The name of the organization associated with the IP address.
*/
public readonly organization: string;
/**
* Instantiates an "Isp" using fields from the response
*
* @param response The GeoIP2-ISP response
*/
public constructor(response: mmdb.IspResponse) {
super(response);
this.isp = response.isp;
this.mobileCountryCode = response.mobile_country_code;
this.mobileNetworkCode = response.mobile_network_code;
this.organization = response.organization;
}
}