Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 826ae9b commit eb91932Copy full SHA for eb91932
test/parallel/test-os.js
@@ -39,10 +39,6 @@ const is = {
39
}
40
};
41
42
-const flatten = (arr) =>
43
- arr.reduce((acc, c) =>
44
- acc.concat(Array.isArray(c) ? flatten(c) : c), []);
45
-
46
process.env.TMPDIR = '/tmpdir';
47
process.env.TMP = '/tmp';
48
process.env.TEMP = '/temp';
@@ -174,7 +170,8 @@ const netmaskToCIDRSuffixMap = new Map(Object.entries({
174
170
'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff': 128
175
171
}));
176
172
177
-flatten(Object.values(interfaces))
173
+Object.values(interfaces)
+ .flat(Infinity)
178
.map((v) => ({ v, mask: netmaskToCIDRSuffixMap.get(v.netmask) }))
179
.forEach(({ v, mask }) => {
180
assert.ok('cidr' in v, `"cidr" prop not found in ${inspect(v)}`);
0 commit comments