diff --git a/services/document-updater/app.js b/services/document-updater/app.js index 34d116ee9d..b0a2d8ae9f 100644 --- a/services/document-updater/app.js +++ b/services/document-updater/app.js @@ -1,6 +1,5 @@ /* * decaffeinate suggestions: - * DS103: Rewrite code to no longer use __guard__ * DS207: Consider shorter variations of null checks * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md */ @@ -216,16 +215,13 @@ for (const eventName of events) { } const port = - __guard__( - Settings.internal != null ? Settings.internal.documentupdater : undefined, - (x) => x.port - ) || - __guard__( - Settings.apis != null ? Settings.apis.documentupdater : undefined, - (x1) => x1.port - ) || + Settings.internal.documentupdater.port || + (Settings.api && + Settings.api.documentupdater && + Settings.api.documentupdater.port) || 3003 const host = Settings.internal.documentupdater.host || 'localhost' + if (!module.parent) { // Called directly app.listen(port, host, () => { @@ -250,9 +246,3 @@ for (const signal of [ ]) { process.on(signal, shutdownCleanly(signal)) } - -function __guard__(value, transform) { - return typeof value !== 'undefined' && value !== null - ? transform(value) - : undefined -}