koa-trie-router
Advanced tools
Comparing version 2.1.3 to 2.1.4
@@ -35,9 +35,3 @@ /** | ||
} | ||
/** | ||
* @param {*} any | ||
* @returns {Boolean} | ||
*/ | ||
let {isArray} = Array | ||
exports.isArray = isArray | ||
exports.isFunction = isFunction | ||
@@ -44,0 +38,0 @@ exports.isObject = isObject |
@@ -10,3 +10,2 @@ | ||
const { | ||
isArray, | ||
isFunction, | ||
@@ -50,5 +49,7 @@ isObject, | ||
addRoute(method, paths, ...middleware) { | ||
if (isString(paths) || (isArray(paths) && isString(paths[0]))) { | ||
// Is this router[verb](paths, middleware) signature? | ||
if (isString(paths) || isString(paths[0])) { | ||
this[__ADD_ROUTE](method, paths, middleware) | ||
} else { | ||
// Otherwise, signature is router[verb](middleware) | ||
middleware.push(paths) | ||
@@ -133,4 +134,3 @@ this[__ADD_ROUTE](method, undefined, middleware) | ||
paths = isArray(paths) ? paths : [paths] | ||
paths = flatten(paths).filter(Boolean) | ||
paths = flatten([paths]).filter(Boolean) | ||
@@ -137,0 +137,0 @@ assert(paths.length, 'Route must have a path') |
{ | ||
"name": "koa-trie-router", | ||
"description": "Trie-routing for Koa", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Jonathan Ong", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13742
281