Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
17 lines
708 B
Plaintext
17 lines
708 B
Plaintext
import * as qs from 'qs-esm';
|
|
/**
|
|
* A utility function to parse URLSearchParams into a ParsedQs object.
|
|
* This function is a wrapper around the `qs` library.
|
|
* In Next.js, the `useSearchParams()` hook from `next/navigation` returns a `URLSearchParams` object.
|
|
* This function can be used to parse that object into a more usable format.
|
|
* @param {ReadonlyURLSearchParams} searchParams - The URLSearchParams object to parse.
|
|
* @returns {qs.ParsedQs} - The parsed query string object.
|
|
*/
|
|
export function parseSearchParams(searchParams) {
|
|
const search = searchParams.toString();
|
|
return qs.parse(search, {
|
|
depth: 10,
|
|
ignoreQueryPrefix: true
|
|
});
|
|
}
|
|
//# sourceMappingURL=parseSearchParams.js.map |