You've already forked joplin
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user