Skip to content

Commit

Permalink
chrore: some coding style adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
pedronauck committed May 19, 2017
1 parent 4b449fb commit 93dcf6a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions utils/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
const { parse } = require('url')
const UrlPattern = require('url-pattern')

const getParamsAndQuery = (patternOrRoute, url) => {
const getParamsAndQuery = (pattern, url) => {
const { query, pathname } = parse(url, true)

const route =
patternOrRoute instanceof UrlPattern ? patternOrRoute : new UrlPattern(patternOrRoute)

const route = pattern instanceof UrlPattern ? pattern : new UrlPattern(pattern)
const params = route.match(pathname)

return { query, params }
}

Expand Down

0 comments on commit 93dcf6a

Please sign in to comment.