From ff85d224139229b11bc8814103fe6937a3933a9a Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Wed, 7 Aug 2024 15:31:04 +0100 Subject: [PATCH] Replace use of deprecated util.isArray 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 https://github.com/gruntjs/grunt-contrib-connect/issues/286. --- tasks/connect.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/connect.js b/tasks/connect.js index 569c28c..e7449c5 100644 --- a/tasks/connect.js +++ b/tasks/connect.js @@ -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 @@ -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);