mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
decaf cleanup: rewrite code to no longer use __guard__
GitOrigin-RevId: 591dbefe98423ead89505250c4f46c8ad2610305
This commit is contained in:
+2
-21
@@ -1,8 +1,3 @@
|
|||||||
/*
|
|
||||||
* decaffeinate suggestions:
|
|
||||||
* DS103: Rewrite code to no longer use __guard__
|
|
||||||
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
||||||
*/
|
|
||||||
const logger = require('@overleaf/logger')
|
const logger = require('@overleaf/logger')
|
||||||
const settings = require('@overleaf/settings')
|
const settings = require('@overleaf/settings')
|
||||||
|
|
||||||
@@ -11,16 +6,8 @@ const Server = require('./app/js/server')
|
|||||||
|
|
||||||
if (!module.parent) {
|
if (!module.parent) {
|
||||||
// Called directly
|
// Called directly
|
||||||
const port =
|
const port = settings.internal.chat.port
|
||||||
__guard__(
|
const host = settings.internal.chat.host
|
||||||
settings.internal != null ? settings.internal.chat : undefined,
|
|
||||||
x => x.port
|
|
||||||
) || 3010
|
|
||||||
const host =
|
|
||||||
__guard__(
|
|
||||||
settings.internal != null ? settings.internal.chat : undefined,
|
|
||||||
x1 => x1.host
|
|
||||||
) || 'localhost'
|
|
||||||
mongodb
|
mongodb
|
||||||
.waitForDb()
|
.waitForDb()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -39,9 +26,3 @@ if (!module.parent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Server.server
|
module.exports = Server.server
|
||||||
|
|
||||||
function __guard__(value, transform) {
|
|
||||||
return typeof value !== 'undefined' && value !== null
|
|
||||||
? transform(value)
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user