node_js_ipqs_db_reader
Version:
A Node JS implementation of the IPQualityScore flat file IP reputation database reader.
33 lines (32 loc) • 794 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const Binary = require("./BinaryOption");
class AbuseVelocity {
constructor(b) {
this.raw = 0;
if (b.has(Binary.AbuseVelocityTwo)) {
if (b.has(Binary.AbuseVelocityOne)) {
this.raw = 3;
return;
}
this.raw = 1;
return;
}
if (b.has(Binary.AbuseVelocityOne)) {
this.raw = 2;
}
}
toString() {
switch (this.raw) {
case 1:
return 'low';
case 2:
return 'medium';
case 3:
return 'high';
default:
return 'none';
}
}
}
exports.default = AbuseVelocity;