Readme

⚡ Supercharge your query params

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"}]}
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
August 18, 2024