Skip to content

Commit

Permalink
extract query params func - simplified a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
revomhere committed Dec 18, 2023
1 parent 772cf53 commit d15611f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/fetcher/src/helpers/extract-query-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ export const extractQueryParams = (url: string): FetcherRequestQuery => {
if (!parsedUrl.search.startsWith('?')) return {}

return parsedUrl.search
.substring(1)
.split('&')
.split(/[?&]/g)
.map(item => {
if (!item) return {}

const d = item.split('=')

const res = {} as FetcherRequestQuery
Expand Down

0 comments on commit d15611f

Please sign in to comment.