Skip to content

Commit

Permalink
readline: update 6 comparions to strict
Browse files Browse the repository at this point in the history
PR-URL: #11078
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
  • Loading branch information
umairishaq authored and italoacasas committed Feb 14, 2017
1 parent c723d7a commit 6a45c81
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/readline.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ Interface.prototype._tabComplete = function(lastKeypressWasTab) {

// this = Interface instance
function handleGroup(self, group, width, maxColumns) {
if (group.length == 0) {
if (group.length === 0) {
return;
}
var minRows = Math.ceil(group.length / maxColumns);
Expand All @@ -479,15 +479,15 @@ function handleGroup(self, group, width, maxColumns) {
}

function commonPrefix(strings) {
if (!strings || strings.length == 0) {
if (!strings || strings.length === 0) {
return '';
}
if (strings.length === 1) return strings[0];
var sorted = strings.slice().sort();
var min = sorted[0];
var max = sorted[sorted.length - 1];
for (var i = 0, len = min.length; i < len; i++) {
if (min[i] != max[i]) {
if (min[i] !== max[i]) {
return min.slice(0, i);
}
}
Expand Down Expand Up @@ -702,7 +702,7 @@ Interface.prototype._ttyWrite = function(s, key) {
this._previousKey = key;

// Ignore escape key - Fixes #2876
if (key.name == 'escape') return;
if (key.name === 'escape') return;

if (key.ctrl && key.shift) {
/* Control and shift pressed */
Expand Down Expand Up @@ -783,7 +783,7 @@ Interface.prototype._ttyWrite = function(s, key) {
break;

case 'z':
if (process.platform == 'win32') break;
if (process.platform === 'win32') break;
if (this.listenerCount('SIGTSTP') > 0) {
this.emit('SIGTSTP');
} else {
Expand Down Expand Up @@ -995,7 +995,7 @@ function emitKeypressEvents(stream, iface) {
}

function onNewListener(event) {
if (event == 'keypress') {
if (event === 'keypress') {
stream.on('data', onData);
stream.removeListener('newListener', onNewListener);
}
Expand Down

0 comments on commit 6a45c81

Please sign in to comment.