Created
December 18, 2018 23:57
-
-
Save mbroadst/065eba0a73443ee8a0728df3619ace56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
function createCommandOptions(manager, localOptions) { | |
const options = Object.assign( | |
{ | |
host: 'defaultHost', | |
port: 27017, | |
connectionTimeoutMS: 5000, | |
socketTimeoutMS: 0, | |
pool: 1, | |
reconnect: false, | |
emitError: true | |
}, | |
manager.clientOptions, | |
localOptions | |
); | |
return options; | |
} | |
const manager = { options: { host: 'managerHost' } }; | |
const localOptions = { host: 'localOptionsHost' }; | |
const result = createCommandOptions(manager, localOptions); | |
console.log({ result }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment