diff --git a/src/lib/library-ext.d.ts b/src/lib/library-ext.d.ts index 0d373e22f..fd2ec2d7a 100644 --- a/src/lib/library-ext.d.ts +++ b/src/lib/library-ext.d.ts @@ -1,6 +1,5 @@ import { User } from './models' - declare module 'express' { export interface Request { user?: User; diff --git a/src/lib/web/note/util.ts b/src/lib/web/note/util.ts index b88455765..f5285160a 100644 --- a/src/lib/web/note/util.ts +++ b/src/lib/web/note/util.ts @@ -21,7 +21,7 @@ export function findNoteOrCreate (req, res, callback: (note: any) => void, inclu } }).then(function (note) { if (!note) { - return newNote(req, res, "") + return newNote(req, res, '') } if (!checkViewPermission(req, note)) { return errors.errorForbidden(res) diff --git a/src/lib/workers/dmpWorker.ts b/src/lib/workers/dmpWorker.ts index 2aac4df46..604bb7253 100644 --- a/src/lib/workers/dmpWorker.ts +++ b/src/lib/workers/dmpWorker.ts @@ -110,47 +110,47 @@ process.on('message', function (data: Data) { return logger.error('dmp worker error: not enough data') } switch (data.msg) { - case 'create patch': - if (data.lastDoc === undefined || data.currDoc === undefined) { - return logger.error('dmp worker error: not enough data on create patch') - } - try { - const patch: string = createPatch(data.lastDoc, data.currDoc) - processSend({ - msg: 'check', - result: patch, - cacheKey: data.cacheKey - }) - } catch (err) { - logger.error('create patch: dmp worker error', err) - processSend({ - msg: 'error', - error: err, - cacheKey: data.cacheKey - }) - } - break - case 'get revision': - if (data.revisions === undefined || data.count === undefined) { - return logger.error('dmp worker error: not enough data on get revision') - } - try { + case 'create patch': + if (data.lastDoc === undefined || data.currDoc === undefined) { + return logger.error('dmp worker error: not enough data on create patch') + } + try { + const patch: string = createPatch(data.lastDoc, data.currDoc) + processSend({ + msg: 'check', + result: patch, + cacheKey: data.cacheKey + }) + } catch (err) { + logger.error('create patch: dmp worker error', err) + processSend({ + msg: 'error', + error: err, + cacheKey: data.cacheKey + }) + } + break + case 'get revision': + if (data.revisions === undefined || data.count === undefined) { + return logger.error('dmp worker error: not enough data on get revision') + } + try { // eslint-disable-next-line @typescript-eslint/camelcase - const result: { content: string; patch: patch_obj[]; authorship: string } = getRevision(data.revisions, data.count) - processSend({ - msg: 'check', - result: result, - cacheKey: data.cacheKey - }) - } catch (err) { - logger.error('get revision: dmp worker error', err) - processSend({ - msg: 'error', - error: err, - cacheKey: data.cacheKey - }) - } - break + const result: { content: string; patch: patch_obj[]; authorship: string } = getRevision(data.revisions, data.count) + processSend({ + msg: 'check', + result: result, + cacheKey: data.cacheKey + }) + } catch (err) { + logger.error('get revision: dmp worker error', err) + processSend({ + msg: 'error', + error: err, + cacheKey: data.cacheKey + }) + } + break } })