( args: Schema.Top, success: Schema.Top, error: Schema.Top )
| 2658 | const jsonCodec = (schema: Schema.Top) => Schema.toCodecJson(schema as Schema.Codec<unknown, unknown>) |
| 2659 | |
| 2660 | const makeCodec = ( |
| 2661 | args: Schema.Top, |
| 2662 | success: Schema.Top, |
| 2663 | error: Schema.Top |
| 2664 | ): QueryCodec => { |
| 2665 | const successJson = jsonCodec(success) |
| 2666 | const errorJson = jsonCodec(error) |
| 2667 | const argsJson = jsonCodec(args) |
| 2668 | const decodeArgs = Schema.decodeUnknownSync(argsJson) |
| 2669 | return { |
| 2670 | encodeSuccess: Schema.encodeUnknownSync(successJson), |
| 2671 | decodeSuccess: Schema.decodeUnknownSync(successJson), |
| 2672 | decodeSuccessEffect: SchemaParser.decodeUnknownEffect(successJson), |
| 2673 | encodeError: Schema.encodeUnknownSync(errorJson), |
| 2674 | decodeError: Schema.decodeUnknownSync(errorJson), |
| 2675 | isSuccess: Schema.is(success as Schema.Codec<unknown, unknown>), |
| 2676 | decodeArgs: (argsKey) => decodeArgs(JSON.parse(argsKey)) |
| 2677 | } |
| 2678 | } |
| 2679 | |
| 2680 | const quote = (name: string): string => JSON.stringify(name) |
| 2681 |
no test coverage detected