effect-io-ai

Package: effect
Module: SchemaGetter

SchemaGetter.Date

Coerces a value to a Date using new Date(input).

When to use

Use when you need a schema getter to coerce a present string, number, or existing date object into a new date object.

Details

Example (Coercing to a Date)

import { SchemaGetter } from "effect"

const toDate = SchemaGetter.Date<string>()
// Getter<Date, string>

See

Signature

declare const Date: <E extends string | number | Date>() => Getter<Date, E>

Source

Since v4.0.0