querystring
Parse and stringify URL query strings. Forked from query-string
Install
yarn add @chaitin/querystring
Usage
import { parse, stringify } from '@chaitin/querystring'
const result = parse("foo=foo&foo&foo=one&foo=&bat=buz")
{ bat: "buz", foo: ["foo", null, "one", ""] }
let qs = stringify({
page: "10",
pageSize: 200,
filter: ["aaa", "bbb", "ccc", 255]
})
qs === "filter=aaa&filter=bbb&filter=ccc&filter=255&page=10&pageSize=200"
qs = stringify({
page: "10",
pageSize: 200,
filter: ["aaa", "bbb", "ccc", 255]
}, { sort: false })
qs === "page=10&pageSize=200&filter=aaa&filter=bbb&filter=ccc&filter=255"
License
MIT