(schema: S)
| 151 | * @internal |
| 152 | */ |
| 153 | export 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 |
nothing calls this directly
no test coverage detected