qs-add
v1.0.0
Published
Add values to query string of url
Downloads
552
Maintainers
Readme
qs-add
Add query string values to url.
API:
(addition: String | Object) => (url: string) => string
Example:
import qsAdd from 'qs-add';
qsAdd({a: `aa`})(`/foo/bar`);// /foo/bar?a=aa
qsAdd(`a=aa`)(`/foo/bar?a=x`);// /foo/bar?a=aa
qsAdd({a: `aa`})(`https://user:[email protected]:3000/foo/bar?query=string#hash`);
// https://user:[email protected]:3000/foo/bar?query=string&a=aa#hash