diff --git a/lib/controller.js b/lib/controller.js index 7cd30a84..170df8dd 100644 --- a/lib/controller.js +++ b/lib/controller.js @@ -687,8 +687,8 @@ controller.connectToNetwork = function(opts) { } if (security) { - if (securityOptions.indexOf(security) < 0) { - return reject(`"${security}" is not a valid security option. Please choose on of the following: ${securityOptions.join(', ')}`); + if (securityOptions.indexOf(security) === -1) { + return reject(`"${security}" is not a valid security option. Please choose one of the following: ${securityOptions.join(', ')}`); } else if (security.match(/wpa2?/)) { return reject(`"${security}" security is not yet implemented. Please see this issue for more details -> https://github.com/tessel/t2-cli/issues/803`); } @@ -725,7 +725,7 @@ controller.createAccessPoint = function(opts) { reject('Invalid credentials. Must set a password with security option'); } - if (security && securityOptions.indexOf(security) < 0) { + if (security && securityOptions.indexOf(security) === -1) { reject(`${security} is not a valid security option. Please choose on of the following: ${securityOptions.join(', ')}`); }