aboutsummaryrefslogtreecommitdiff
path: root/src/content/usecases/KeymapUseCase.ts
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2019-12-22 11:10:36 +0900
committerGitHub <noreply@github.com>2019-12-22 11:10:36 +0900
commitb1a6f374dca078dee2406ebe049715b826e37ca2 (patch)
tree5367c48648e2018f55f12d847baba94559e10040 /src/content/usecases/KeymapUseCase.ts
parentb2dcdedad729ff7087867da50e20578f9fc8fb29 (diff)
parentda72c2ddd916d79d134662e3985b53a4ac78af7a (diff)
Merge pull request #690 from ueokande/eslint-and-prettier
Eslint and prettier
Diffstat (limited to 'src/content/usecases/KeymapUseCase.ts')
-rw-r--r--src/content/usecases/KeymapUseCase.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/content/usecases/KeymapUseCase.ts b/src/content/usecases/KeymapUseCase.ts
index a2e7cc3..074de72 100644
--- a/src/content/usecases/KeymapUseCase.ts
+++ b/src/content/usecases/KeymapUseCase.ts
@@ -37,17 +37,17 @@ export default class KeymapUseCase {
// eslint-disable-next-line max-statements
nextOps(key: Key): { repeat: number, op: operations.Operation } | null {
- let sequence = this.repository.enqueueKey(key);
- let baseSequence = sequence.trimNumericPrefix();
+ const sequence = this.repository.enqueueKey(key);
+ const baseSequence = sequence.trimNumericPrefix();
if (baseSequence.length() === 1 && this.blacklistKey(key)) {
// ignore if the input starts with black list keys
this.repository.clear();
return null;
}
- let keymaps = this.keymapEntityMap();
- let matched = keymaps.filter(([seq]) => seq.startsWith(sequence));
- let baseMatched = keymaps.filter(([seq]) => seq.startsWith(baseSequence));
+ const keymaps = this.keymapEntityMap();
+ const matched = keymaps.filter(([seq]) => seq.startsWith(sequence));
+ const baseMatched = keymaps.filter(([seq]) => seq.startsWith(baseSequence));
if (matched.length === 1 &&
sequence.length() === matched[0][0].length()) {
@@ -71,7 +71,7 @@ export default class KeymapUseCase {
}
private keymapEntityMap(): [KeySequence, operations.Operation][] {
- let keymaps = this.settingRepository.get().keymaps.combine(reservedKeymaps);
+ const keymaps = this.settingRepository.get().keymaps.combine(reservedKeymaps);
let entries = keymaps.entries().map(
([keys, op]) => [KeySequence.fromMapKeys(keys), op]
) as [KeySequence, operations.Operation][];
@@ -86,8 +86,8 @@ export default class KeymapUseCase {
}
private blacklistKey(key: Key): boolean {
- let url = this.addressRepository.getCurrentURL();
- let blacklist = this.settingRepository.get().blacklist;
+ const url = this.addressRepository.getCurrentURL();
+ const blacklist = this.settingRepository.get().blacklist;
return blacklist.includeKey(url, key);
}
}