@burnsred/toolkit
v1.0.0
Published
## querystring
Downloads
37
Readme
BurnsRED Toolkit
querystring
Utilities for parsing querystrings into objects, and serialising them back.
Internally it depends on URLSearchParams
querystring.stringify
will turn an object into a querystring, automatically handling Array values as repeats, and skipping null
values.
querystring.parse
will turn a string into an object, coalescing repeated keys into Arrays.
useQueryParams
A hook to parse the querystring from react-router
, using the querystring
library.
This differs from react-router
's useSearchParams
in that it returns a coalesced object, not a UrlSearchParams
instance.