aboutsummaryrefslogtreecommitdiff
path: root/src/pages/completion.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/completion.js')
-rw-r--r--src/pages/completion.js27
1 files changed, 0 insertions, 27 deletions
diff --git a/src/pages/completion.js b/src/pages/completion.js
deleted file mode 100644
index 4c69afb..0000000
--- a/src/pages/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;
- }
-}