(value)
| 52 | } |
| 53 | |
| 54 | function asStringArray(value) { |
| 55 | if (Array.isArray(value)) return value.filter((v) => typeof v === "string" && v.trim()); |
| 56 | if (typeof value === "string") return value.split(",").map((v) => v.trim()).filter(Boolean); |
| 57 | return []; |
| 58 | } |
| 59 | |
| 60 | function asPositiveInt(value) { |
| 61 | const n = typeof value === "number" ? value : Number.parseInt(String(value), 10); |