From 13977d83deb5f6f4b69a5ba6fa7e76c5053ab015 Mon Sep 17 00:00:00 2001 From: almic Date: Mon, 20 May 2024 09:04:18 -0600 Subject: [PATCH] Use Array.flat instead of array-flatten --- lib/application.js | 4 ++-- package.json | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/application.js b/lib/application.js index 43c9f34b062..ecfe2186db7 100644 --- a/lib/application.js +++ b/lib/application.js @@ -21,7 +21,6 @@ var http = require('http'); var compileETag = require('./utils').compileETag; var compileQueryParser = require('./utils').compileQueryParser; var compileTrust = require('./utils').compileTrust; -var flatten = require('array-flatten').flatten var merge = require('utils-merge'); var resolve = require('path').resolve; var once = require('once') @@ -34,6 +33,7 @@ var setPrototypeOf = require('setprototypeof') */ var slice = Array.prototype.slice; +var flatten = Array.prototype.flat; /** * Application prototype. @@ -209,7 +209,7 @@ app.use = function use(fn) { } } - var fns = flatten(slice.call(arguments, offset)); + var fns = flatten.call(slice.call(arguments, offset), Infinity); if (fns.length === 0) { throw new TypeError('app.use() requires a middleware function') diff --git a/package.json b/package.json index d3e2f0a1909..5ec37a8f773 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,6 @@ ], "dependencies": { "accepts": "~1.3.8", - "array-flatten": "3.0.0", "body-parser": "2.0.0-beta.2", "content-disposition": "0.5.4", "content-type": "~1.0.4",