@lucid-softworks/http-query
v0.1.0
Published
Parsing and serialization for repeated HTTP query parameters.
Maintainers
Readme
@lucid-softworks/http-query
Lossless query parsing and serialization with repeated-key support.
import {
parseHttpQuery,
stringifyHttpQuery,
} from "@lucid-softworks/http-query";
parseHttpQuery("?tag=a&tag=b"); // { tag: ["a", "b"] }
stringifyHttpQuery({ page: 2, tag: ["a", "b"] });Singular values remain strings, repeated values become arrays, null becomes
an empty value, and undefined is omitted.
