@dynacom/core
Advanced tools
Comparing version 1.1.11 to 1.1.12
@@ -32,3 +32,2 @@ const Future = require( '@dynacom/futures' ); | ||
route( a ) { | ||
@@ -40,7 +39,15 @@ if ( a instanceof Route ) { | ||
if ( a.hasOwnProperty( routePath ) ) { | ||
let handler = a[ routePath ]; | ||
this.routes.push( new Route( routePath, handler ) ); | ||
let b = a[ routePath ]; | ||
let handler = typeof b == 'function' ? b : b.handler; | ||
let method = typeof b == 'function' ? null : b.method; | ||
this.routes.push( new Route( routePath, method, handler ) ); | ||
} | ||
} | ||
} | ||
} else if (Array.isArray( a )){ | ||
a.forEach( | ||
route => { | ||
this.routes.push( new Route( route.pattern, route.method, route.handler ) ); | ||
} | ||
); | ||
} | ||
return this; | ||
@@ -47,0 +54,0 @@ } |
@@ -10,3 +10,3 @@ { | ||
, "name": "@dynacom/core" | ||
, "version": "1.1.11" | ||
, "version": "1.1.12" | ||
, "repository": { | ||
@@ -13,0 +13,0 @@ "type": "git" |
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
19962
404