Skip to content

Commit

Permalink
fix(controller): typo, clearer logic
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterBrown committed Aug 18, 2016
1 parent 09a34f6 commit 7e6f135
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
Expand Down Expand Up @@ -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(', ')}`);
}

Expand Down

0 comments on commit 7e6f135

Please sign in to comment.