You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
First pass at linting lib dir
This commit is contained in:
@@ -2,7 +2,6 @@ const BaseService = require('lib/services/BaseService.js');
|
||||
const Mutex = require('async-mutex').Mutex;
|
||||
|
||||
class KvStore extends BaseService {
|
||||
|
||||
static instance() {
|
||||
if (this.instance_) return this.instance_;
|
||||
this.instance_ = new KvStore();
|
||||
@@ -26,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) {
|
||||
@@ -81,7 +80,7 @@ class KvStore extends BaseService {
|
||||
} catch (error) {
|
||||
release();
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async searchByPrefix(prefix) {
|
||||
@@ -93,10 +92,9 @@ class KvStore extends BaseService {
|
||||
const r = await this.db().selectOne('SELECT count(*) as total FROM key_values');
|
||||
return r.total ? r.total : 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
KvStore.TYPE_INT = 1;
|
||||
KvStore.TYPE_TEXT = 2;
|
||||
|
||||
module.exports = KvStore;
|
||||
module.exports = KvStore;
|
||||
|
||||
Reference in New Issue
Block a user