Skip to content

Commit

Permalink
Use Array.flat instead of array-flatten (#5677)
Browse files Browse the repository at this point in the history
  • Loading branch information
almic authored Aug 1, 2024
1 parent 723b545 commit d106bf5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -34,6 +33,7 @@ var setPrototypeOf = require('setprototypeof')
*/

var slice = Array.prototype.slice;
var flatten = Array.prototype.flat;

/**
* Application prototype.
Expand Down Expand Up @@ -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')
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d106bf5

Please sign in to comment.