(name?: string)
| 337 | |
| 338 | /** @internal */ |
| 339 | export const duration = (name?: string): Config.Config<Duration.Duration> => { |
| 340 | const config = mapOrFail(string(), (value) => { |
| 341 | const duration = Duration.decodeUnknown(value) |
| 342 | return Either.fromOption( |
| 343 | duration, |
| 344 | () => configError.InvalidData([], `Expected a duration but received ${formatUnknown(value)}`) |
| 345 | ) |
| 346 | }) |
| 347 | return name === undefined ? config : nested(config, name) |
| 348 | } |
| 349 | |
| 350 | /** @internal */ |
| 351 | export const map = dual< |
nothing calls this directly
no test coverage detected