(name?: string)
| 233 | |
| 234 | /** @internal */ |
| 235 | export const date = (name?: string): Config.Config<Date> => { |
| 236 | const config = primitive( |
| 237 | "a date property", |
| 238 | (text) => { |
| 239 | const result = Date.parse(text) |
| 240 | if (Number.isNaN(result)) { |
| 241 | return Either.left( |
| 242 | configError.InvalidData( |
| 243 | [], |
| 244 | `Expected a Date value but received ${formatUnknown(text)}` |
| 245 | ) |
| 246 | ) |
| 247 | } |
| 248 | return Either.right(new Date(result)) |
| 249 | } |
| 250 | ) |
| 251 | return name === undefined ? config : nested(config, name) |
| 252 | } |
| 253 | |
| 254 | /** @internal */ |
| 255 | export const fail = (message: string): Config.Config<never> => { |
nothing calls this directly
no test coverage detected
searching dependent graphs…