mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-01-27 00:33:23 +00:00
Run eslint --fix on lib/
Signed-off-by: David Mehren <dmehren1@gmail.com>
This commit is contained in:
parent
7359b468e4
commit
b65ae091bd
3 changed files with 41 additions and 42 deletions
1
src/lib/library-ext.d.ts
vendored
1
src/lib/library-ext.d.ts
vendored
|
@ -1,6 +1,5 @@
|
|||
import { User } from './models'
|
||||
|
||||
|
||||
declare module 'express' {
|
||||
export interface Request {
|
||||
user?: User;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue