fn queryObject changed
This commit is contained in:
1 parent
8745c4a703
commit
a52b845285
1 file changed
+2
-3
+2
-3
@@ -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()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user