@restmatic/server
Version:
The core Pomegranate plugins for RestMatic
15 lines • 516 B
JavaScript
;
/**
* @file ExtractMiddleware
* @author Jim Bulkowski <jim.b@paperelectron.com>
* @project server
* @license MIT {@link http://opensource.org/licenses/MIT}
*/
Object.defineProperty(exports, "__esModule", { value: true });
const fp_1 = require("lodash/fp");
exports.extractMiddleware = (Middleware) => {
return fp_1.compose(fp_1.filter((mw) => fp_1.isFunction(mw.fn)), fp_1.map((mw) => {
return { fn: Middleware[mw], name: mw };
}));
};
//# sourceMappingURL=ExtractMiddleware.js.map