Spaces:
Runtime error
Runtime error
Download src/lib/query-string.ts from Ali-Developments/COURTRIX: direct link, hf CLI and curl.
- Browser
- Download file 447 Bytes
-
https://huggingface.co/spaces/Ali-Developments/COURTRIX/resolve/main/src/lib/query-string.ts
- Command line
-
hf download hf://spaces/Ali-Developments/COURTRIX/src/lib/query-string.ts
-
curl -L -o query-string.ts https://huggingface.co/spaces/Ali-Developments/COURTRIX/resolve/main/src/lib/query-string.ts
447 Bytes
| type QueryValue = string | number | null | undefined; | |
| export function buildQueryString( | |
| current: URLSearchParams, | |
| updates: Record<string, QueryValue>, | |
| ) { | |
| const params = new URLSearchParams(current); | |
| Object.entries(updates).forEach(([key, value]) => { | |
| if (value === null || value === undefined || value === "") { | |
| params.delete(key); | |
| return; | |
| } | |
| params.set(key, String(value)); | |
| }); | |
| return params.toString(); | |
| } | |