Better manage default options

This commit is contained in:
Anthony Laibe 2018-09-14 10:17:01 +01:00
parent 323ec0d529
commit ab859d4ef5
1 changed files with 3 additions and 1 deletions

View File

@ -14,7 +14,9 @@ class ProcessWrapper {
*
* @param {Options} options pingParent: true by default
*/
constructor(options = {pingParent: true}) {
constructor(argOptions = {}) {
const defaultOptions = {pingParent: true}
const options = {...defaultOptions, ...argOptions};
this.interceptLogs();
this.events = new Events();
if(options.pingParent) {