awilix-router-core
Advanced tools
Comparing version 1.4.0 to 1.5.0
@@ -15,9 +15,19 @@ "use strict"; | ||
.map(function (path) { | ||
var items = []; | ||
var required = require(path); | ||
// Support default exports (ES6). | ||
if (required.default) { | ||
required = required.default; | ||
if (required) { | ||
var stateAndTarget = state_util_1.getStateAndTarget(required); | ||
if (stateAndTarget) { | ||
items.push(stateAndTarget); | ||
return items; | ||
} | ||
// loop through exports - this will cover named as well as a default export | ||
for (var _i = 0, _a = Object.keys(required); _i < _a.length; _i++) { | ||
var key = _a[_i]; | ||
items.push(state_util_1.getStateAndTarget(required[key])); | ||
} | ||
} | ||
return state_util_1.getStateAndTarget(required); | ||
return items; | ||
}) | ||
.reduce(function (acc, cur) { return acc.concat(cur); }, []) | ||
.filter(function (x) { return x !== null; }); | ||
@@ -24,0 +34,0 @@ } |
{ | ||
"name": "awilix-router-core", | ||
"version": "1.4.0", | ||
"version": "1.5.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -54,2 +54,5 @@ # awilix-router-core | ||
**Note**: in the examples below, an ES6 `default` export is used, but named exports and multiple exports | ||
per file are supported. | ||
## With decorators | ||
@@ -56,0 +59,0 @@ |
Sorry, the diff of this file is not supported yet
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
52093
874
303