systeminformation
Advanced tools
Comparing version 5.17.11 to 5.17.12
@@ -1050,21 +1050,25 @@ 'use strict'; | ||
function getUniqueMacAdresses() { | ||
const ifaces = os.networkInterfaces(); | ||
let macs = []; | ||
for (let dev in ifaces) { | ||
if ({}.hasOwnProperty.call(ifaces, dev)) { | ||
ifaces[dev].forEach(function (details) { | ||
if (details && details.mac && details.mac !== '00:00:00:00:00:00') { | ||
const mac = details.mac.toLowerCase(); | ||
if (macs.indexOf(mac) === -1) { | ||
macs.push(mac); | ||
try { | ||
const ifaces = os.networkInterfaces(); | ||
for (let dev in ifaces) { | ||
if ({}.hasOwnProperty.call(ifaces, dev)) { | ||
ifaces[dev].forEach(function (details) { | ||
if (details && details.mac && details.mac !== '00:00:00:00:00:00') { | ||
const mac = details.mac.toLowerCase(); | ||
if (macs.indexOf(mac) === -1) { | ||
macs.push(mac); | ||
} | ||
} | ||
} | ||
}); | ||
}); | ||
} | ||
} | ||
macs = macs.sort(function (a, b) { | ||
if (a < b) { return -1; } | ||
if (a > b) { return 1; } | ||
return 0; | ||
}); | ||
} catch (e) { | ||
macs.push('00:00:00:00:00:00'); | ||
} | ||
macs = macs.sort(function (a, b) { | ||
if (a < b) { return -1; } | ||
if (a > b) { return 1; } | ||
return 0; | ||
}); | ||
return macs; | ||
@@ -1071,0 +1075,0 @@ } |
{ | ||
"name": "systeminformation", | ||
"version": "5.17.11", | ||
"version": "5.17.12", | ||
"description": "Advanced, lightweight system and OS information library", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
726106
15345