Skip to content

Commit

Permalink
Replace use of deprecated util.isArray
Browse files Browse the repository at this point in the history
Array.isArray() is part of ES5 and has been in Node since
at least Node 4, probably earlier even. This package requires
Node 16+.

As of Node.js 22.0.0, util.isArray has a runtime deprecation
warning.

Fixes #286.
  • Loading branch information
Krinkle authored Aug 7, 2024
1 parent a241e61 commit ff85d22
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions tasks/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ module.exports = function(grunt) {
var open = require('open');
var portscanner = require('portscanner');
var async = require('async');
var util = require('util');

var MAX_PORTS = 30; // Maximum available ports to check after the specified port

Expand Down Expand Up @@ -161,7 +160,7 @@ module.exports = function(grunt) {
};

middleware.forEach(function (m) {
if (!util.isArray(m)) {
if (!Array.isArray(m)) {
m = [m];
}
app.use.apply(app, m);
Expand Down

0 comments on commit ff85d22

Please sign in to comment.