(value: unknown)
| 19 | } |
| 20 | |
| 21 | export function parseStringArray(value: unknown): string[] | undefined { |
| 22 | if (!Array.isArray(value)) { |
| 23 | return undefined; |
| 24 | } |
| 25 | |
| 26 | const out: string[] = []; |
| 27 | const seen = new Set<string>(); |
| 28 | for (const item of value) { |
| 29 | const parsed = parseNonEmptyString(item); |
| 30 | if (!parsed || seen.has(parsed)) { |
| 31 | continue; |
| 32 | } |
| 33 | seen.add(parsed); |
| 34 | out.push(parsed); |
| 35 | } |
| 36 | |
| 37 | return out.length > 0 ? out : undefined; |
| 38 | } |
| 39 | |
| 40 | export function parseAgentId(value: unknown): string | undefined { |
| 41 | if (typeof value !== "string" || value.trim().length === 0) { |
no test coverage detected