@feathersjs/express
Advanced tools
Comparing version 4.0.0-pre.3 to 4.0.0-pre.4
@@ -6,2 +6,15 @@ # Change Log | ||
# [4.0.0-pre.4](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.3...v4.0.0-pre.4) (2019-07-05) | ||
### Bug Fixes | ||
* @feathersjs/express: allow middleware arrays ([#1421](https://github.com/feathersjs/feathers/issues/1421)) ([b605ab8](https://github.com/feathersjs/feathers/commit/b605ab8)) | ||
* @feathersjs/express: replace `reduce` with `map` ([#1429](https://github.com/feathersjs/feathers/issues/1429)) ([44542e9](https://github.com/feathersjs/feathers/commit/44542e9)) | ||
* Clean up hooks code ([#1407](https://github.com/feathersjs/feathers/issues/1407)) ([f25c88b](https://github.com/feathersjs/feathers/commit/f25c88b)) | ||
# [4.0.0-pre.3](https://github.com/feathersjs/feathers/compare/v4.0.0-pre.2...v4.0.0-pre.3) (2019-06-01) | ||
@@ -8,0 +21,0 @@ |
@@ -31,3 +31,3 @@ const express = require('express'); | ||
.reduce(function (middleware, arg) { | ||
if (typeof arg === 'function') { | ||
if (typeof arg === 'function' || Array.isArray(arg)) { | ||
middleware[service ? 'after' : 'before'].push(arg); | ||
@@ -46,3 +46,3 @@ } else if (!service) { | ||
const hasMethod = methods => methods.some(name => | ||
(service && !Array.isArray(service) && typeof service[name] === 'function') | ||
(service && typeof service[name] === 'function') | ||
); | ||
@@ -49,0 +49,0 @@ |
@@ -35,12 +35,12 @@ const errors = require('@feathersjs/errors'); | ||
function makeArgsGetter (argsOrder) { | ||
return (req, params) => argsOrder.reduce((result, argName) => { | ||
return (req, params) => argsOrder.map((argName) => { | ||
switch (argName) { | ||
case 'id': | ||
return [ ...result, req.params.__feathersId || null ]; | ||
return req.params.__feathersId || null; | ||
case 'data': | ||
return [ ...result, req.body ]; | ||
return req.body; | ||
case 'params': | ||
return [ ...result, params ]; | ||
return params; | ||
} | ||
}, []); | ||
}); | ||
} | ||
@@ -47,0 +47,0 @@ |
{ | ||
"name": "@feathersjs/express", | ||
"description": "Feathers Express framework bindings and REST provider", | ||
"version": "4.0.0-pre.3", | ||
"version": "4.0.0-pre.4", | ||
"homepage": "https://feathersjs.com", | ||
@@ -39,4 +39,4 @@ "main": "lib/", | ||
"dependencies": { | ||
"@feathersjs/commons": "^4.0.0-pre.3", | ||
"@feathersjs/errors": "^4.0.0-pre.3", | ||
"@feathersjs/commons": "^4.0.0-pre.4", | ||
"@feathersjs/errors": "^4.0.0-pre.4", | ||
"@types/express": "^4.16.1", | ||
@@ -48,6 +48,6 @@ "debug": "^4.1.1", | ||
"devDependencies": { | ||
"@feathersjs/authentication": "^4.0.0-pre.3", | ||
"@feathersjs/authentication-local": "^4.0.0-pre.3", | ||
"@feathersjs/feathers": "^4.0.0-pre.3", | ||
"@feathersjs/tests": "^4.0.0-pre.3", | ||
"@feathersjs/authentication": "^4.0.0-pre.4", | ||
"@feathersjs/authentication-local": "^4.0.0-pre.4", | ||
"@feathersjs/feathers": "^4.0.0-pre.4", | ||
"@feathersjs/tests": "^4.0.0-pre.4", | ||
"axios": "^0.19.0", | ||
@@ -58,3 +58,3 @@ "chai": "^4.2.0", | ||
}, | ||
"gitHead": "19eb75737659e3e4b57765c1653d23c86fd2e1c3" | ||
"gitHead": "f20fd5899a217afad7ad2a45b3fc3dfdc788c714" | ||
} |
323123