switch between searchStr and paramsObj
$ npm install url-param
import { u } from 'url-param'
const searchStr = u({ q: '⭐' })
// => '?q=%E2%AD%90'
const paramsObj = u('?q=%E2%AD%90')
// => {q: "⭐"}
const urlObj = u('https://www.google.com/search?q=%E2%AD%90')
// => {q: "⭐"}
// say `location.search` is '?a=%21&%CE%B2=2'
u() // => {a: "!", β: "2"}
u('a') // => '!'
u().β // => '2'
u()['β'] // => '2'
MIT