diff --git a/index.js b/index.js index 0dbe740..fac31f1 100644 --- a/index.js +++ b/index.js @@ -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') @@ -27,6 +26,7 @@ const setPrototypeOf = require('setprototypeof') */ const slice = Array.prototype.slice +const flatten = Array.prototype.flat /** * Expose `Router`. @@ -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') diff --git a/package.json b/package.json index c118ec6..153e133 100644 --- a/package.json +++ b/package.json @@ -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",