diff options
Diffstat (limited to 'src/background/repositories')
6 files changed, 12 insertions, 12 deletions
diff --git a/src/background/repositories/BookmarkRepository.ts b/src/background/repositories/BookmarkRepository.ts index d266ae6..0d2a1fc 100644 --- a/src/background/repositories/BookmarkRepository.ts +++ b/src/background/repositories/BookmarkRepository.ts @@ -5,7 +5,7 @@ export default class BookmarkRepository { async create( title: string, url: string ): Promise<browser.bookmarks.BookmarkTreeNode> { - let item = await browser.bookmarks.create({ + const item = await browser.bookmarks.create({ type: 'bookmark', title, url, diff --git a/src/background/repositories/BrowserSettingRepository.ts b/src/background/repositories/BrowserSettingRepository.ts index 9cfb35e..a47b64d 100644 --- a/src/background/repositories/BrowserSettingRepository.ts +++ b/src/background/repositories/BrowserSettingRepository.ts @@ -20,7 +20,7 @@ declare namespace browser.browserSettings.homepageOverride { @injectable() export default class BrowserSettingRepository { async getHomepageUrls(): Promise<string[]> { - let { value } = await browser.browserSettings.homepageOverride.get({}); + const { value } = await browser.browserSettings.homepageOverride.get({}); return value.split('|').map(urls.normalizeUrl); } } diff --git a/src/background/repositories/CompletionsRepository.ts b/src/background/repositories/CompletionsRepository.ts index dfdbc27..dfecff0 100644 --- a/src/background/repositories/CompletionsRepository.ts +++ b/src/background/repositories/CompletionsRepository.ts @@ -6,7 +6,7 @@ type BookmarkTreeNode = browser.bookmarks.BookmarkTreeNode; @injectable() export default class CompletionsRepository { async queryBookmarks(keywords: string): Promise<BookmarkTreeNode[]> { - let items = await browser.bookmarks.search({ query: keywords }); + const items = await browser.bookmarks.search({ query: keywords }); return items.filter((item) => { if (!item.url) { return false; @@ -29,7 +29,7 @@ export default class CompletionsRepository { } async queryTabs(keywords: string, excludePinned: boolean): Promise<Tab[]> { - let tabs = await browser.tabs.query({ currentWindow: true }); + const tabs = await browser.tabs.query({ currentWindow: true }); return tabs.filter((t) => { return t.url && t.url.toLowerCase().includes(keywords.toLowerCase()) || t.title && t.title.toLowerCase().includes(keywords.toLowerCase()); diff --git a/src/background/repositories/MarkRepository.ts b/src/background/repositories/MarkRepository.ts index c106fff..1f4ab0c 100644 --- a/src/background/repositories/MarkRepository.ts +++ b/src/background/repositories/MarkRepository.ts @@ -13,17 +13,17 @@ export default class MarkRepository { } getMark(key: string): Promise<GlobalMark | undefined> { - let marks = this.getOrEmptyMarks(); - let data = marks[key]; + const marks = this.getOrEmptyMarks(); + const data = marks[key]; if (!data) { return Promise.resolve(undefined); } - let mark = { tabId: data.tabId, url: data.url, x: data.x, y: data.y }; + const mark = { tabId: data.tabId, url: data.url, x: data.x, y: data.y }; return Promise.resolve(mark); } setMark(key: string, mark: GlobalMark): Promise<any> { - let marks = this.getOrEmptyMarks(); + const marks = this.getOrEmptyMarks(); marks[key] = { tabId: mark.tabId, url: mark.url, x: mark.x, y: mark.y }; this.cache.set(MARK_KEY, marks); diff --git a/src/background/repositories/PersistentSettingRepository.ts b/src/background/repositories/PersistentSettingRepository.ts index e3b78b3..c10f2cf 100644 --- a/src/background/repositories/PersistentSettingRepository.ts +++ b/src/background/repositories/PersistentSettingRepository.ts @@ -4,7 +4,7 @@ import SettingData from '../../shared/SettingData'; @injectable() export default class SettingRepository { async load(): Promise<SettingData | null> { - let { settings } = await browser.storage.local.get('settings'); + const { settings } = await browser.storage.local.get('settings'); if (!settings) { return null; } diff --git a/src/background/repositories/SettingRepository.ts b/src/background/repositories/SettingRepository.ts index e775a32..ba24e36 100644 --- a/src/background/repositories/SettingRepository.ts +++ b/src/background/repositories/SettingRepository.ts @@ -14,7 +14,7 @@ export default class SettingRepository { } get(): Promise<Settings> { - let data = this.cache.get(CACHED_SETTING_KEY); + const data = this.cache.get(CACHED_SETTING_KEY); return Promise.resolve(Settings.fromJSON(data)); } @@ -25,7 +25,7 @@ export default class SettingRepository { async setProperty( name: string, value: string | number | boolean, ): Promise<void> { - let def = Properties.def(name); + const def = Properties.def(name); if (!def) { throw new Error('unknown property: ' + name); } @@ -37,7 +37,7 @@ export default class SettingRepository { newValue = def.defaultValue; } - let current = await this.get(); + const current = await this.get(); switch (name) { case 'hintchars': current.properties.hintchars = newValue as string; |