test: minor refactor in common/index.js
PR-URL: https://github.com/nodejs/node/pull/22738 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: George Adams <george.adams@uk.ibm.com>
This commit is contained in:
parent
08d983c3b9
commit
a93f035212
@ -143,16 +143,14 @@ const PIPE = (() => {
|
||||
return path.join(pipePrefix, pipeName);
|
||||
})();
|
||||
|
||||
let hasIPv6;
|
||||
{
|
||||
const hasIPv6 = (() => {
|
||||
const iFaces = os.networkInterfaces();
|
||||
const re = isWindows ? /Loopback Pseudo-Interface/ : /lo/;
|
||||
hasIPv6 = Object.keys(iFaces).some(function(name) {
|
||||
return re.test(name) && iFaces[name].some(function(info) {
|
||||
return info.family === 'IPv6';
|
||||
});
|
||||
return Object.keys(iFaces).some((name) => {
|
||||
return re.test(name) &&
|
||||
iFaces[name].some(({ family }) => family === 'IPv6');
|
||||
});
|
||||
}
|
||||
})();
|
||||
|
||||
/*
|
||||
* Check that when running a test with
|
||||
|
Loading…
x
Reference in New Issue
Block a user