Caught mixed usage, use .find() not .filter() to locate a single entry. Test exising methods now.

This commit is contained in:
mmcwilliams 2018-01-01 00:10:50 -05:00
parent 7e58ac40aa
commit bcc29424da
1 changed files with 3 additions and 3 deletions

View File

@ -91,8 +91,8 @@ class Wifi {
console.log(data)
parsed = parseConfig(data)
console.dir(parsed)
current = parsed.filter(network => {
return (network.ssid + '').toLowerCase() === (_ssid + '').toLowerCase()
current = parsed.find(network => {
return network.ssid === _ssid
})
console.log(current)
if (typeof current !== 'undefined') {
@ -102,7 +102,7 @@ class Wifi {
}
console.log(data)
_entry = null
this._writeConfigCb(null)
setTimeout(this._writeConfigCb, 1)
//fs.writeFile(filePath, data, 'utf8', this._writeConfigCb)
}
/**