Skip to content

Commit a40f842

Browse files
umairishaqMylesBorins
authored andcommitted
readline: update 6 comparions to strict
PR-URL: #11078 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
1 parent a557d6c commit a40f842

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
@@ -424,7 +424,7 @@ Interface.prototype._tabComplete = function() {
424424

425425
// this = Interface instance
426426
function handleGroup(self, group, width, maxColumns) {
427-
if (group.length == 0) {
427+
if (group.length === 0) {
428428
return;
429429
}
430430
var minRows = Math.ceil(group.length / maxColumns);
@@ -449,14 +449,14 @@ function handleGroup(self, group, width, maxColumns) {
449449
}
450450

451451
function commonPrefix(strings) {
452-
if (!strings || strings.length == 0) {
452+
if (!strings || strings.length === 0) {
453453
return '';
454454
}
455455
var sorted = strings.slice().sort();
456456
var min = sorted[0];
457457
var max = sorted[sorted.length - 1];
458458
for (var i = 0, len = min.length; i < len; i++) {
459-
if (min[i] != max[i]) {
459+
if (min[i] !== max[i]) {
460460
return min.slice(0, i);
461461
}
462462
}
@@ -669,7 +669,7 @@ Interface.prototype._ttyWrite = function(s, key) {
669669
key = key || {};
670670

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

674674
if (key.ctrl && key.shift) {
675675
/* Control and shift pressed */
@@ -750,7 +750,7 @@ Interface.prototype._ttyWrite = function(s, key) {
750750
break;
751751

752752
case 'z':
753-
if (process.platform == 'win32') break;
753+
if (process.platform === 'win32') break;
754754
if (this.listenerCount('SIGTSTP') > 0) {
755755
this.emit('SIGTSTP');
756756
} else {
@@ -955,7 +955,7 @@ function emitKeypressEvents(stream, iface) {
955955
}
956956

957957
function onNewListener(event) {
958-
if (event == 'keypress') {
958+
if (event === 'keypress') {
959959
stream.on('data', onData);
960960
stream.removeListener('newListener', onNewListener);
961961
}

0 commit comments

Comments
 (0)