@@ -63,7 +63,7 @@ var API = module.exports = function(opts) {
6363 if ( opts . pm2_home ) {
6464 // Override default conf file
6565 this . pm2_home = opts . pm2_home ;
66- conf = util . _extend ( conf , path_structure ( this . pm2_home ) ) ;
66+ conf = Object . assign ( conf , path_structure ( this . pm2_home ) ) ;
6767 }
6868 else if ( opts . independent == true && conf . IS_WINDOWS === false ) {
6969 // Create an unique pm2 instance
@@ -75,7 +75,7 @@ var API = module.exports = function(opts) {
7575 // It will go as in proc
7676 if ( typeof ( opts . daemon_mode ) == 'undefined' )
7777 this . daemon_mode = false ;
78- conf = util . _extend ( conf , path_structure ( this . pm2_home ) ) ;
78+ conf = Object . assign ( conf , path_structure ( this . pm2_home ) ) ;
7979 }
8080
8181 this . _conf = conf ;
@@ -299,7 +299,7 @@ API.prototype.start = function(cmd, opts, cb) {
299299
300300 var that = this ;
301301
302- if ( util . isArray ( opts . watch ) && opts . watch . length === 0 )
302+ if ( Array . isArray ( opts . watch ) && opts . watch . length === 0 )
303303 opts . watch = ( opts . rawArgs ? ! ! ~ opts . rawArgs . indexOf ( '--watch' ) : ! ! ~ process . argv . indexOf ( '--watch' ) ) || false ;
304304
305305 if ( Common . isConfigFile ( cmd ) || ( typeof ( cmd ) === 'object' ) )
@@ -760,7 +760,7 @@ API.prototype._startScript = function(script, opts, cb) {
760760 resolved_paths . env [ 'PM2_HOME' ] = that . pm2_home ;
761761
762762 var additional_env = Modularizer . getAdditionalConf ( resolved_paths . name ) ;
763- util . _extend ( resolved_paths . env , additional_env ) ;
763+ Object . assign ( resolved_paths . env , additional_env ) ;
764764
765765 // Is KM linked?
766766 resolved_paths . km_link = that . gl_is_km_linked ;
@@ -940,7 +940,7 @@ API.prototype._startJson = function(file, opts, action, pipe, cb) {
940940 // Notice: if people use the same name in different apps,
941941 // duplicated envs will be overrode by the last one
942942 var env = envs . reduce ( function ( e1 , e2 ) {
943- return util . _extend ( e1 , e2 ) ;
943+ return Object . assign ( e1 , e2 ) ;
944944 } ) ;
945945
946946 // When we are processing JSON, allow to keep the new env by default
@@ -1012,7 +1012,7 @@ API.prototype._startJson = function(file, opts, action, pipe, cb) {
10121012 resolved_paths . env [ 'PM2_HOME' ] = that . pm2_home ;
10131013
10141014 var additional_env = Modularizer . getAdditionalConf ( resolved_paths . name ) ;
1015- util . _extend ( resolved_paths . env , additional_env ) ;
1015+ Object . assign ( resolved_paths . env , additional_env ) ;
10161016
10171017 resolved_paths . env = Common . mergeEnvironmentVariables ( resolved_paths , opts . env , deployConf ) ;
10181018
@@ -1226,7 +1226,7 @@ API.prototype._operate = function(action_name, process_name, envs, cb) {
12261226 if ( conf . PM2_PROGRAMMATIC == true )
12271227 new_env = Common . safeExtend ( { } , process . env ) ;
12281228 else
1229- new_env = util . _extend ( { } , process . env ) ;
1229+ new_env = Object . assign ( { } , process . env ) ;
12301230
12311231 Object . keys ( envs ) . forEach ( function ( k ) {
12321232 new_env [ k ] = envs [ k ] ;
@@ -1355,7 +1355,7 @@ API.prototype._operate = function(action_name, process_name, envs, cb) {
13551355 * if yes load configuration variables and merge with the current environment
13561356 */
13571357 var additional_env = Modularizer . getAdditionalConf ( process_name ) ;
1358- util . _extend ( envs , additional_env ) ;
1358+ Object . assign ( envs , additional_env ) ;
13591359
13601360 return processIds ( ids , cb ) ;
13611361 } ) ;
@@ -1401,7 +1401,7 @@ API.prototype._handleAttributeUpdate = function(opts) {
14011401
14021402 delete appConf . exec_mode ;
14031403
1404- if ( util . isArray ( appConf . watch ) && appConf . watch . length === 0 ) {
1404+ if ( Array . isArray ( appConf . watch ) && appConf . watch . length === 0 ) {
14051405 if ( ! ~ opts . rawArgs . indexOf ( '--watch' ) )
14061406 delete appConf . watch
14071407 }
0 commit comments