Skip to content

Commit

Permalink
fix: deprecated waring util.isArray
Browse files Browse the repository at this point in the history
  • Loading branch information
Connormiha committed May 13, 2024
1 parent a092db2 commit 1bb5d0b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/sourcemap-auto-resolve/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ API.prototype.start = function(cmd, opts, cb) {

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'))
Expand Down Expand Up @@ -1401,7 +1401,7 @@ API.prototype._handleAttributeUpdate = function(opts) {

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
}
Expand Down
4 changes: 2 additions & 2 deletions lib/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 1 addition & 2 deletions lib/Watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* can be found in the LICENSE file.
*/
var chokidar = require('chokidar');
var util = require('util');
var log = require('debug')('pm2:watch');

module.exports = function ClusterMode(God) {
Expand All @@ -29,7 +28,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);
Expand Down

0 comments on commit 1bb5d0b

Please sign in to comment.