From ab859d4ef51a4855ded70fefc059d6be5e4a0d2a Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 14 Sep 2018 10:17:01 +0100 Subject: [PATCH 1/2] Better manage default options --- lib/core/processes/processWrapper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core/processes/processWrapper.js b/lib/core/processes/processWrapper.js index a897505c1..e8bdd8e7e 100644 --- a/lib/core/processes/processWrapper.js +++ b/lib/core/processes/processWrapper.js @@ -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) { From 2c30271d29fc562e9dff00ad694f75bc604251f2 Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Fri, 14 Sep 2018 10:30:20 +0100 Subject: [PATCH 2/2] please linter --- lib/core/processes/processWrapper.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/core/processes/processWrapper.js b/lib/core/processes/processWrapper.js index e8bdd8e7e..26137474d 100644 --- a/lib/core/processes/processWrapper.js +++ b/lib/core/processes/processWrapper.js @@ -14,12 +14,11 @@ class ProcessWrapper { * * @param {Options} options pingParent: true by default */ - constructor(argOptions = {}) { - const defaultOptions = {pingParent: true} - const options = {...defaultOptions, ...argOptions}; + constructor(options = {}) { + this.options = Object.assign({pingParent: true}, options); this.interceptLogs(); this.events = new Events(); - if(options.pingParent) { + if(this.options.pingParent) { this.pingParent(); } }