diff --git a/bin/callback.js b/bin/callback.js index f9acc27..1bc0444 100644 --- a/bin/callback.js +++ b/bin/callback.js @@ -4,15 +4,7 @@ const CALLBACK_URL = process.env.CALLBACK_URL ? new URL(process.env.CALLBACK_URL const CALLBACK_TIMEOUT = process.env.CALLBACK_TIMEOUT || 5000 const CALLBACK_OBJECTS = process.env.CALLBACK_OBJECTS ? JSON.parse(process.env.CALLBACK_OBJECTS) : {} -/** - * @return {Boolean} - */ -exports.isCallbackSet = () => { - if (CALLBACK_URL) { - return true - } - return false -} +exports.isCallbackSet = !!CALLBACK_URL /** * @param {Uint8Array} update diff --git a/bin/utils.js b/bin/utils.js index 5e2cb08..1138961 100644 --- a/bin/utils.js +++ b/bin/utils.js @@ -118,7 +118,7 @@ class WSSharedDoc extends Y.Doc { } this.awareness.on('update', awarenessChangeHandler) this.on('update', updateHandler) - if (isCallbackSet()) { + if (isCallbackSet) { this.on('update', debounce( callbackHandler, CALLBACK_DEBOUNCE_WAIT,