(value: string | string[] | undefined)
| 41 | } |
| 42 | |
| 43 | function parseAllowedRoots(value: string | string[] | undefined): string[] { |
| 44 | if (Array.isArray(value)) { |
| 45 | const roots = value.map((entry) => entry.trim()).filter(Boolean); |
| 46 | return (roots.length > 0 ? roots : [process.cwd()]).map((root) => resolve(expandHomePath(root))); |
| 47 | } |
| 48 | |
| 49 | const rawRoots = |
| 50 | value |
| 51 | ?.split(",") |
| 52 | .map((entry) => entry.trim()) |
| 53 | .filter(Boolean) ?? []; |
| 54 | |
| 55 | const roots = rawRoots.length > 0 ? rawRoots : [process.cwd()]; |
| 56 | return roots.map((root) => resolve(expandHomePath(root))); |
| 57 | } |
| 58 | |
| 59 | function parseAllowedHosts(value: string | string[] | undefined, derivedHosts: string[]): string[] { |
| 60 | if (Array.isArray(value)) { |
no test coverage detected