superchargedQueryParams
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Tired of the old x=y
query param limitations?
Ever wished you could say x>y
or x!=y
as well?
Now you can! Parse query params with superchargedQueryParams
and you get an array of operations for each parameter instead:
import { superchargeQueryParams } from "https://esm.town/v/neverstew/superchargeQueryParams";
console.log(superchargeQueryParams(new URL("https://example.com?a=b&c>d&e!=f&e>=g")))
// {"a":[{"eq":"b"}],"c":[{"gt":"d"}],"e":[{"ne":"f"},{"gte":"g"}]}
Migrated from folder: supercharged/superchargedQueryParams