diff --git a/lib/API.js b/lib/API.js index 0e2bed944..8b7bf2fa6 100644 --- a/lib/API.js +++ b/lib/API.js @@ -322,7 +322,7 @@ class API { if (!opts) opts = {}; var that = this; - if (util.isArray(opts.watch) && opts.watch.length === 0) + if (Array.isArray(opts.watch) && opts.watch.length === 0) opts.watch = (opts.rawArgs ? !!~opts.rawArgs.indexOf('--watch') : !!~process.argv.indexOf('--watch')) || false; if (Common.isConfigFile(cmd) || (typeof(cmd) === 'object')) { @@ -1611,7 +1611,7 @@ class API { delete appConf.exec_mode; - if (util.isArray(appConf.watch) && appConf.watch.length === 0) { + if (Array.isArray(appConf.watch) && appConf.watch.length === 0) { if (!~opts.rawArgs.indexOf('--watch')) delete appConf.watch } diff --git a/lib/Watcher.js b/lib/Watcher.js index 9dbe6b095..9835ec7f9 100644 --- a/lib/Watcher.js +++ b/lib/Watcher.js @@ -29,7 +29,7 @@ module.exports = function ClusterMode(God) { var watch = pm2_env.watch - if(typeof watch == 'boolean' || util.isArray(watch) && watch.length === 0) + if(typeof watch == 'boolean' || Array.isArray(watch) && watch.length === 0) watch = pm2_env.pm_cwd; log('Watching %s', watch);