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

Function toCodecStrict

packages/effect/src/encoding/SchemaBinary.ts:153–166  ·  view source on GitHub ↗
(schema: S)

Source from the content-addressed store, hash-verified

151 * @internal
152 */
153export function toCodecStrict<S extends Schema.Constraint>(schema: S): toCodec<S> {
154 const cached = strictCodecCache.get(schema)
155 if (cached !== undefined) return cached
156 const { exact, layout, recursive, target } = compileTarget(schema)
157 const trusted: Trusted | undefined = exact ? { value: undefined } : undefined
158 const codec = assembleCodec<S>(
159 trusted === undefined ? target : withTrustedDecode(target, trusted, !recursive),
160 layout,
161 strictMode,
162 trusted
163 )
164 strictCodecCache.set(schema, codec)
165 return codec
166}
167
168/**
169 * Derives the {@link toCodec} codec without the schema pass around the binary

Callers

nothing calls this directly

Calls 5

compileTargetFunction · 0.85
assembleCodecFunction · 0.85
withTrustedDecodeFunction · 0.85
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected