Skip to content

Commit 9f43e80

Browse files
committed
ESLint
1 parent 57b341f commit 9f43e80

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/model/monitor.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ class Monitor extends BeanModel {
350350

351351
try {
352352
if (this.type === "ping" || this.type === "port" || this.type === "dns" ) {
353-
if (this.ipFamily == 4 || this.ipFamily == 6) {
353+
if (this.ipFamily === 4 || this.ipFamily === 6) {
354354
try {
355355
let lookup;
356356
if (this.type === "dns") {
@@ -360,7 +360,7 @@ class Monitor extends BeanModel {
360360
}
361361
const [ address, family ] = await Monitor.lookup(lookup, this.ipFamily);
362362
log.debug("monitor", `hostname: ${lookup}, ipFamily: ${this.ipFamily}, address: ${address}, family: ${family}`);
363-
if (this.ipFamily != family) {
363+
if (this.ipFamily !== family) {
364364
throw "Error: Incorrect IP family.";
365365
}
366366
if (this.type === "dns") {
@@ -1563,6 +1563,12 @@ class Monitor extends BeanModel {
15631563
return parent.active && parentActive;
15641564
}
15651565

1566+
/**
1567+
* lookup the hostname and return a single IP Address of the specified IP address family.
1568+
* @param {string} hostname hostname to lookup
1569+
* @param {int} family valid values are 4 or 6 - for IPv4 or IPv6 respectively
1570+
* @returns {[string address, int family]} the resolved address and IP address family
1571+
*/
15661572
static async lookup(hostname, family) {
15671573
return new Promise((resolve, reject) => {
15681574
const options = {

0 commit comments

Comments
 (0)