Skip to content

Commit 6a45c81

Browse files
umairishaqitaloacasas
authored andcommitted
readline: update 6 comparions to strict
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]>
1 parent c723d7a commit 6a45c81

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/readline.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ Interface.prototype._tabComplete = function(lastKeypressWasTab) {
454454

455455
// this = Interface instance
456456
function handleGroup(self, group, width, maxColumns) {
457-
if (group.length == 0) {
457+
if (group.length === 0) {
458458
return;
459459
}
460460
var minRows = Math.ceil(group.length / maxColumns);
@@ -479,15 +479,15 @@ function handleGroup(self, group, width, maxColumns) {
479479
}
480480

481481
function commonPrefix(strings) {
482-
if (!strings || strings.length == 0) {
482+
if (!strings || strings.length === 0) {
483483
return '';
484484
}
485485
if (strings.length === 1) return strings[0];
486486
var sorted = strings.slice().sort();
487487
var min = sorted[0];
488488
var max = sorted[sorted.length - 1];
489489
for (var i = 0, len = min.length; i < len; i++) {
490-
if (min[i] != max[i]) {
490+
if (min[i] !== max[i]) {
491491
return min.slice(0, i);
492492
}
493493
}
@@ -702,7 +702,7 @@ Interface.prototype._ttyWrite = function(s, key) {
702702
this._previousKey = key;
703703

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

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

785785
case 'z':
786-
if (process.platform == 'win32') break;
786+
if (process.platform === 'win32') break;
787787
if (this.listenerCount('SIGTSTP') > 0) {
788788
this.emit('SIGTSTP');
789789
} else {
@@ -995,7 +995,7 @@ function emitKeypressEvents(stream, iface) {
995995
}
996996

997997
function onNewListener(event) {
998-
if (event == 'keypress') {
998+
if (event === 'keypress') {
999999
stream.on('data', onData);
10001000
stream.removeListener('newListener', onNewListener);
10011001
}

0 commit comments

Comments
 (0)