fix: bug on ParseQueryArray

This commit is contained in:
monoid 2024-12-27 20:44:22 +09:00
parent fa23178baf
commit bea6a9c290

View File

@ -7,7 +7,7 @@ export function ParseQueryNumber(s: string[] | string | undefined): number | und
} }
export function ParseQueryArray(s: string[] | string | undefined) { export function ParseQueryArray(s: string[] | string | undefined) {
const input = s ?? []; const input = s ?? [];
const r = Array.isArray(input) ? input : [input]; const r = Array.isArray(input) ? input : input.split(",");
return r.map((x) => decodeURIComponent(x)); return r.map((x) => decodeURIComponent(x));
} }
export function ParseQueryArgString(s: string[] | string | undefined) { export function ParseQueryArgString(s: string[] | string | undefined) {