( target: Schema.Constraint, trusted: Trusted, bypassEncode: boolean )
| 5466 | // only lets values the binary layer just produced through, so every other |
| 5467 | // input, `Schema.is` included, still runs the real check. |
| 5468 | function withTrustedDecode( |
| 5469 | target: Schema.Constraint, |
| 5470 | trusted: Trusted, |
| 5471 | bypassEncode: boolean |
| 5472 | ): Schema.Constraint { |
| 5473 | return bypassPass( |
| 5474 | target, |
| 5475 | (input) => takeTrusted(trusted, input), |
| 5476 | // A recursive schema keeps the pass on encode: decoding cannot build a |
| 5477 | // cycle, but a caller can hand one in, and the cycle walk lives there. |
| 5478 | bypassEncode ? reportsExcess : constFalse |
| 5479 | ) |
| 5480 | } |
| 5481 | |
| 5482 | function constFalse(): boolean { |
| 5483 | return false |
no test coverage detected