// function that trims all keys and values and transforms keys to lowercase constnormalizeUrlSearchParams = pipe( map(([key, value]) => [key.trim(), value.trim()]), map(([key, value]) => [key.toLowerCase(), value]), );
// build a function that first normalizes and then parses URLSearchParams constnormalizeAndParse = pipe( normalizeUrlSearchParams, parseUrlSearchParams );
// the incoming URLSearchParams to parse consturlSearchParams = newURLSearchParams(` ?category=a &category=b &active=true &page=1,5 `);
This module contains utilities for working with URLSearchParams
Example