restored Node 4.x compatibility
This commit is contained in:
+1
-1
@@ -728,7 +728,7 @@ function graphics(callback) {
|
||||
const nvidiaData = nvidiaDevices();
|
||||
// needs to be rewritten ... using no spread operators
|
||||
result.controllers = result.controllers.map((controller) => { // match by busAddress
|
||||
return mergeControllerNvidia(controller, nvidiaData.find(({ pciBus }) => pciBus.toLowerCase().endsWith(controller.busAddress.toLowerCase())) || {});
|
||||
return mergeControllerNvidia(controller, nvidiaData.find((controller) => controller.pciBus.toLowerCase().endsWith(controller.busAddress.toLowerCase())) || {});
|
||||
});
|
||||
}
|
||||
let cmd = 'clinfo --raw';
|
||||
|
||||
+4
-1
@@ -683,12 +683,15 @@ function testVirtualNic(iface, ifaceName, mac) {
|
||||
} else { return false; }
|
||||
}
|
||||
|
||||
function networkInterfaces(callback, rescan = true) {
|
||||
function networkInterfaces(callback, rescan) {
|
||||
|
||||
if (typeof callback === 'boolean') {
|
||||
rescan = callback;
|
||||
callback = null;
|
||||
}
|
||||
if (typeof rescan === 'undefined') {
|
||||
rescan = true;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
process.nextTick(() => {
|
||||
let ifaces = os.networkInterfaces();
|
||||
|
||||
+2
-1
@@ -540,7 +540,8 @@ function countLines(lines, startingWith) {
|
||||
return uniqueLines.length;
|
||||
}
|
||||
|
||||
function sanitizeShellString(str, strict = false) {
|
||||
function sanitizeShellString(str, strict) {
|
||||
if (typeof strict === 'undefined') { strict = false; }
|
||||
const s = str || '';
|
||||
let result = '';
|
||||
for (let i = 0; i <= mathMin(s.length, 2000); i++) {
|
||||
|
||||
Reference in New Issue
Block a user