(str: string)
| 163 | } |
| 164 | |
| 165 | function parseBoolean(str: string): ParsedData<boolean> { |
| 166 | switch (str) { |
| 167 | case "true": |
| 168 | return { data: true }; |
| 169 | case "false": |
| 170 | return { data: false }; |
| 171 | default: |
| 172 | return { error: `${str} is not a boolean` }; |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | function parseArray<T>( |
| 177 | values: string[], |