diff options
author | Danny Nemer <hi@DannyNemer.com> | 2017-03-20 18:30:41 -0400 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-03-22 08:56:24 -0700 |
commit | c8eec76c5fa7a31794380d1a56ccdb722cd7da5e (patch) | |
tree | 47d67955f3c6df3dac9913e298554913f20a658d /lib | |
parent | e26b6c6baa297580ecb49df9d2d869bc181ac7fe (diff) | |
download | android-node-v8-c8eec76c5fa7a31794380d1a56ccdb722cd7da5e.tar.gz android-node-v8-c8eec76c5fa7a31794380d1a56ccdb722cd7da5e.tar.bz2 android-node-v8-c8eec76c5fa7a31794380d1a56ccdb722cd7da5e.zip |
readline: rename `deDupeHistory` option
Renames `options.deDupeHistory` → `options.removeHistoryDuplicates` for
`readline.createInterface(options)`.
The option name `removeHistoryDuplicates` is preferable to the
semantically identical name `deDupeHistory` because "dedupe" (short for
"deduplication") is obscure and neologistic while
`removeHistoryDuplicates` is clear, though verbose.
Updates tests and documentation for this option accordingly.
PR-URL: https://github.com/nodejs/node/pull/11950
Ref: https://github.com/nodejs/node/pull/2982
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/readline.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/readline.js b/lib/readline.js index 3b719560b6..d324561556 100644 --- a/lib/readline.js +++ b/lib/readline.js @@ -60,7 +60,7 @@ function Interface(input, output, completer, terminal) { EventEmitter.call(this); var historySize; - var deDupeHistory = false; + var removeHistoryDuplicates = false; let crlfDelay; let prompt = '> '; @@ -70,7 +70,7 @@ function Interface(input, output, completer, terminal) { completer = input.completer; terminal = input.terminal; historySize = input.historySize; - deDupeHistory = input.deDupeHistory; + removeHistoryDuplicates = input.removeHistoryDuplicates; if (input.prompt !== undefined) { prompt = input.prompt; } @@ -103,7 +103,7 @@ function Interface(input, output, completer, terminal) { this.output = output; this.input = input; this.historySize = historySize; - this.deDupeHistory = !!deDupeHistory; + this.removeHistoryDuplicates = !!removeHistoryDuplicates; this.crlfDelay = Math.max(kMincrlfDelay, Math.min(kMaxcrlfDelay, crlfDelay >>> 0)); @@ -281,7 +281,7 @@ Interface.prototype._addHistory = function() { if (this.line.trim().length === 0) return this.line; if (this.history.length === 0 || this.history[0] !== this.line) { - if (this.deDupeHistory) { + if (this.removeHistoryDuplicates) { // Remove older history line if identical to new one const dupIndex = this.history.indexOf(this.line); if (dupIndex !== -1) this.history.splice(dupIndex, 1); |