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

Function Defect

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

Source from the content-addressed store, hash-verified

9369 * @since 4.0.0
9370 */
9371export function Defect(options?: ErrorOptions): Defect {
9372 const key = getErrorOptionsKey(options)
9373 const cached = defectSchemaCache[key]
9374 if (cached !== undefined) {
9375 return cached
9376 }
9377 const schema = Json.pipe(decodeTo(Unknown, SchemaTransformation.defectFromJson(getErrorOptions(key))))
9378 defectSchemaCache[key] = schema
9379 return schema
9380}
9381/**
9382 * Type-level representation returned by {@link ReadonlyMap}.
9383 *

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