diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-30 20:27:26 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2017-09-30 20:36:17 +0900 |
commit | 6551420e1ae0e91201de72e862e918dd3c97ab43 (patch) | |
tree | 1aa9de8949cd76c4f65adfc9424f63bf479669e9 /src/console/completion.js | |
parent | 1145eb34784c1450b920f8e7d672934ef6a98d45 (diff) |
move messages to content
Diffstat (limited to 'src/console/completion.js')
-rw-r--r-- | src/console/completion.js | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/console/completion.js b/src/console/completion.js deleted file mode 100644 index 4c69afb..0000000 --- a/src/console/completion.js +++ /dev/null @@ -1,27 +0,0 @@ -export default class Completion { - constructor(completions) { - if (typeof completions.length !== 'number') { - throw new TypeError('completions does not have a length in number'); - } - this.completions = completions; - this.index = 0; - } - - prev() { - let length = this.completions.length; - if (length === 0) { - return null; - } - this.index = (this.index + length - 1) % length; - return this.completions[this.index]; - } - - next() { - if (this.completions.length === 0) { - return null; - } - let item = this.completions[this.index]; - this.index = (this.index + 1) % this.completions.length; - return item; - } -} |