Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function resolve4(next) {
dns.resolve4(name, function resolve4Callback(err, arr) {
if (arr) {
arr.forEach(address => addresses.push({ address, isIPv6: false }));
}
// Ignore error
next();
});
},
function resolve6(next) {
TEST(function test_resolve4(done) {
var req = dns.resolve4('www.google.com', function(err, ips) {
if (err) throw err;
assert.ok(ips.length > 0);
for (var i = 0; i < ips.length; i++) {
assert.ok(isIPv4(ips[i]));
}
done();
});
checkWrap(req);
});
return new Promise((resolve, reject) => {
dns.resolve4(address, (err, ips) => {
if(err) {
return reject(err);
}
if(ips.sort) {
ips = ips.sort();
}
return resolve(ips);
});
});
};
(next) => {
if (target.match(/[a-z]/i) && !target.match(/\//) && !net.isIPv6(target)) {
dns.resolve4(target, next);
} else {
next(null,[[target]]);
}
}
],(err,result) => {
function(next) {
if (target.match(/[a-z]/i) && !target.match(/\//) && !net.isIPv6(target)) {
dns.resolve4(target,next);
} else {
next(null,[[target]]);
}
}
],function(err,result) {