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

Function Defect

packages/effect/src/Schema.ts:10769–10778  ·  view source on GitHub ↗
(options?: ErrorOptions)

Source from the content-addressed store, hash-verified

10767 * @since 4.0.0
10768 */
10769export function Defect(options?: ErrorOptions): Defect {
10770 const key = getErrorOptionsKey(options)
10771 const cached = defectSchemaCache[key]
10772 if (cached !== undefined) {
10773 return cached
10774 }
10775 const schema = Json.pipe(decodeTo(Unknown, SchemaTransformation.defectFromJson(getErrorOptions(key))))
10776 defectSchemaCache[key] = schema
10777 return schema
10778}
10779
10780/**
10781 * Type-level representation returned by {@link Exit}.

Callers

nothing calls this directly

Calls 4

getErrorOptionsKeyFunction · 0.85
getErrorOptionsFunction · 0.85
decodeToFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected