MCPcopy Create free account
hub / github.com/Effect-TS/effect / duration

Function duration

packages/effect/src/internal/config.ts:348–357  ·  view source on GitHub ↗
(name?: string)

Source from the content-addressed store, hash-verified

346
347/** @internal */
348export const duration = (name?: string): Config.Config<Duration.Duration> => {
349 const config = mapOrFail(string(), (value) => {
350 const duration = Duration.decodeUnknown(value)
351 return Either.fromOption(
352 duration,
353 () => configError.InvalidData([], `Expected a duration but received ${formatUnknown(value)}`)
354 )
355 })
356 return name === undefined ? config : nested(config, name)
357}
358
359/** @internal */
360export const map = dual<

Callers

nothing calls this directly

Calls 2

formatUnknownFunction · 0.85
stringFunction · 0.70

Tested by

no test coverage detected