1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-14 23:26:58 +02:00

Chore: Apply eslint rules

This commit is contained in:
Laurent Cozic
2019-09-19 22:51:18 +01:00
parent ab29d7e872
commit e648392330
185 changed files with 1196 additions and 1196 deletions

View File

@@ -25,7 +25,7 @@ class KvStore extends BaseService {
typeFromValue_(value) {
if (typeof value === 'string') return KvStore.TYPE_TEXT;
if (typeof value === 'number') return KvStore.TYPE_INT;
throw new Error('Unsupported value type: ' + typeof value);
throw new Error(`Unsupported value type: ${typeof value}`);
}
formatValues_(kvs) {
@@ -39,8 +39,8 @@ class KvStore extends BaseService {
formatValue_(value, type) {
if (type === KvStore.TYPE_INT) return Number(value);
if (type === KvStore.TYPE_TEXT) return value + '';
throw new Error('Unknown type: ' + type);
if (type === KvStore.TYPE_TEXT) return `${value}`;
throw new Error(`Unknown type: ${type}`);
}
async value(key) {
@@ -84,7 +84,7 @@ class KvStore extends BaseService {
}
async searchByPrefix(prefix) {
let results = await this.db().selectAll('SELECT `key`, `value`, `type` FROM key_values WHERE `key` LIKE ?', [prefix + '%']);
let results = await this.db().selectAll('SELECT `key`, `value`, `type` FROM key_values WHERE `key` LIKE ?', [`${prefix}%`]);
return this.formatValues_(results);
}