(name?: string)
| 242 | |
| 243 | /** @internal */ |
| 244 | export const date = (name?: string): Config.Config<Date> => { |
| 245 | const config = primitive( |
| 246 | "a date property", |
| 247 | (text) => { |
| 248 | const result = Date.parse(text) |
| 249 | if (Number.isNaN(result)) { |
| 250 | return Either.left( |
| 251 | configError.InvalidData( |
| 252 | [], |
| 253 | `Expected a Date value but received ${formatUnknown(text)}` |
| 254 | ) |
| 255 | ) |
| 256 | } |
| 257 | return Either.right(new Date(result)) |
| 258 | } |
| 259 | ) |
| 260 | return name === undefined ? config : nested(config, name) |
| 261 | } |
| 262 | |
| 263 | /** @internal */ |
| 264 | export const fail = (message: string): Config.Config<never> => { |
nothing calls this directly
no test coverage detected