MCPcopy Index your code
hub / github.com/Effect-TS/effect / date

Function date

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

Source from the content-addressed store, hash-verified

233
234/** @internal */
235export 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 */
255export const fail = (message: string): Config.Config<never> => {

Callers

nothing calls this directly

Calls 3

primitiveFunction · 0.85
formatUnknownFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…