@@ -350,7 +350,7 @@ class Monitor extends BeanModel {
350
350
351
351
try {
352
352
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 ) {
354
354
try {
355
355
let lookup ;
356
356
if ( this . type === "dns" ) {
@@ -360,7 +360,7 @@ class Monitor extends BeanModel {
360
360
}
361
361
const [ address , family ] = await Monitor . lookup ( lookup , this . ipFamily ) ;
362
362
log . debug ( "monitor" , `hostname: ${ lookup } , ipFamily: ${ this . ipFamily } , address: ${ address } , family: ${ family } ` ) ;
363
- if ( this . ipFamily != family ) {
363
+ if ( this . ipFamily !== family ) {
364
364
throw "Error: Incorrect IP family." ;
365
365
}
366
366
if ( this . type === "dns" ) {
@@ -1563,6 +1563,12 @@ class Monitor extends BeanModel {
1563
1563
return parent . active && parentActive ;
1564
1564
}
1565
1565
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
+ */
1566
1572
static async lookup ( hostname , family ) {
1567
1573
return new Promise ( ( resolve , reject ) => {
1568
1574
const options = {
0 commit comments