(schema: S, disableCodecs: boolean | undefined)
| 606 | // The schema used for CSV cells. `toCodecStringTree` keeps the decoded type and |
| 607 | // services and only changes the encoded side, which is treated as unknown here. |
| 608 | const toCodec = <S extends Schema.Constraint>(schema: S, disableCodecs: boolean | undefined): S => { |
| 609 | if (disableCodecs === true) return schema |
| 610 | let codec = stringTreeCodecs.get(schema) |
| 611 | if (codec === undefined) { |
| 612 | codec = Schema.toCodecStringTree(schema) |
| 613 | stringTreeCodecs.set(schema, codec) |
| 614 | } |
| 615 | return codec as S |
| 616 | } |
| 617 | |
| 618 | const toArrayCodec = <S extends Schema.Constraint>(codec: S): Schema.NonEmptyArray<S> => { |
| 619 | let array = arrayCodecs.get(codec) |
no test coverage detected