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

Function dateTimeUtcFromInput

packages/effect/src/SchemaGetter.ts:1631–1641  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1629 * @since 4.0.0
1630 */
1631export function dateTimeUtcFromInput<E extends DateTime.DateTime.Input>(): Getter<DateTime.Utc, E> {
1632 return transformOrFail((input, options) => {
1633 return Option.match(DateTime.make(input), {
1634 onNone: () =>
1635 Effect.fail(
1636 new SchemaIssue.InvalidValue({ message: "Invalid DateTime input" }, input, options)
1637 ),
1638 onSome: (dt) => Effect.succeed(DateTime.toUtc(dt))
1639 })
1640 })
1641}
1642
1643/**
1644 * Decodes a `FormData` object into a nested tree structure using bracket-path notation.

Callers

nothing calls this directly

Calls 4

transformOrFailFunction · 0.70
makeMethod · 0.65
failMethod · 0.45
succeedMethod · 0.45

Tested by

no test coverage detected