node_js_ipqs_db_reader
Version:
A Node JS implementation of the IPQualityScore flat file IP reputation database reader.
46 lines (45 loc) • 1.17 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Binary = require("./BinaryOption");
class ConnectionType {
constructor(b) {
this.raw = 0;
if (b.has(Binary.ConnectionTypeThree)) {
if (b.has(Binary.ConnectionTypeTwo)) {
this.raw = 3;
return;
}
if (b.has(Binary.ConnectionTypeOne)) {
this.raw = 5;
return;
}
this.raw = 1;
return;
}
if (b.has(Binary.ConnectionTypeTwo)) {
this.raw = 2;
return;
}
if (b.has(Binary.ConnectionTypeOne)) {
this.raw = 4;
return;
}
}
toString() {
switch (this.raw) {
case 1:
return "Residential";
case 2:
return "Mobile";
case 3:
return "Corporate";
case 4:
return "Data Center";
case 5:
return "Education";
default:
return "Unknown";
}
}
}
exports.default = ConnectionType;