Convert a search param string, URL instance, or URLSearchParams instance into an object of search params. Note that a search param string must start with '?'.
URL
URLSearchParams
'?'
Optional
import {searchParamsToObject} from 'url-vir';searchParamsToObject('?hello=there&cheese'); // `{hello: ['there'], cheese: []}` Copy
import {searchParamsToObject} from 'url-vir';searchParamsToObject('?hello=there&cheese'); // `{hello: ['there'], cheese: []}`
Convert a search param string,
URLinstance, orURLSearchParamsinstance into an object of search params. Note that a search param string must start with'?'.