fn queryObject changed

This commit is contained in:
tmshv committed 2018-05-23 10:21:08 +03:00
1 parent 8745c4a703
commit a52b845285
1 file changed
+2 -3
+2 -3
View File
@@ -10,15 +10,14 @@ export function queryObject() {
const processors = [toTrue, toFalse]
return async(ctx, next) => {
let query = ctx.query
ctx.query = Object
.keys(query)
.keys(ctx.query)
.reduce((query, key) => assign(
query,
key,
processors
.reduce((value, fn) => fn(value), query[key])
), query)
), ctx.query)
await next()
}