Skip to content

Commit

Permalink
Merge pull request #9 from ShaneVV/master
Browse files Browse the repository at this point in the history
fix: it should reserve original options object rather than break it
vagusX authored Jul 27, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 2568b9d + 84b2523 commit 59786ad
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ module.exports = (context, options) => (ctx, next) => {
const match = route(context)
if (!match(ctx.req.url)) return next()

let opts = options
let opts = Object.assign({}, options)
if (typeof options === 'function') {
const params = match(ctx.req.url)
opts = options.call(options, params)

0 comments on commit 59786ad

Please sign in to comment.