diff --git a/README.md b/README.md index 6616760..ca45807 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ The tool returns an array with objects, each object representing a network with * channel: WiFi channel * ssid: SSID of the network (if available) -* mac: MAC Address of the network access point +* mac: MAC Address of the network access point (if available, otherwise empty string) * rssi: signal strength In contrary to other wifi scanners no information about security is returned. This is due to the very different implementation diff --git a/lib/airport.js b/lib/airport.js index 1f48e40..894a0fe 100644 --- a/lib/airport.js +++ b/lib/airport.js @@ -20,11 +20,11 @@ function parseOutput(str, callback) { let lines = str.split('\n'); for (let i = 1, l = lines.length; i < l; i++) { - if (lines[i] == '') continue; - let elements = lines[i].substr(51).split(/[ ]+/); + if (lines[i] === '') continue; + let elements = lines[i].substring(51).split(/[ ]+/); wifis.push({ - 'ssid' : lines[i].substr(0,32).trim(), - 'mac' : lines[i].substr(33,17).trim(), + 'ssid' : lines[i].substring(0, 32).trim(), + 'mac' : '', // There is no more mac on a mac 'channel': parseInt(elements[1].trim(), 10), 'rssi' : parseInt(elements[0].trim(), 10) }); diff --git a/package.json b/package.json index 931f289..80f25d8 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ "test": "mocha test" }, "dependencies": { - "async": "3.1.0", - "lodash": "4.17.15" + "async": "3.2.4", + "lodash": "4.17.21" }, "devDependencies": { - "grunt": "^1.0.3", + "grunt": "1.5.3", "grunt-bump": "0.8.0", - "mocha": "6.2.0" + "mocha": "10.2.0" } }