Skip to content

Commit

Permalink
Use Array.flat instead of array-flatten package
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip9587 committed Oct 21, 2024
1 parent 2e7fb67 commit ab0d79f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
* @private
*/

const flatten = require('array-flatten').flatten
const isPromise = require('is-promise')
const Layer = require('./lib/layer')
const methods = require('methods')
Expand All @@ -27,6 +26,7 @@ const setPrototypeOf = require('setprototypeof')
*/

const slice = Array.prototype.slice
const flatten = Array.prototype.flat

/**
* Expose `Router`.
Expand Down Expand Up @@ -374,7 +374,7 @@ Router.prototype.use = function use (handler) {
}
}

const callbacks = flatten(slice.call(arguments, offset))
const callbacks = flatten.call(slice.call(arguments, offset), Infinity)

if (callbacks.length === 0) {
throw new TypeError('argument handler is required')
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"license": "MIT",
"repository": "pillarjs/router",
"dependencies": {
"array-flatten": "3.0.0",
"is-promise": "4.0.0",
"methods": "~1.1.2",
"parseurl": "~1.3.3",
Expand Down

0 comments on commit ab0d79f

Please sign in to comment.