(value: unknown)
| 2757 | const drop = lazy(() => dropUndefinedOf(args.ast)) |
| 2758 | const codec = lazy(() => makeCodec(args, options.success, error)) |
| 2759 | const argsKey = (value: unknown): string => { |
| 2760 | const encode = encodeArgs() |
| 2761 | let encoded: unknown |
| 2762 | try { |
| 2763 | encoded = encode(value) |
| 2764 | } catch { |
| 2765 | // The Schema issue prints the value, so it isn't passed on. |
| 2766 | throw new Error( |
| 2767 | "[Query] " + quote(name) + |
| 2768 | ": the args don't encode with the query's args Schema" |
| 2769 | ) |
| 2770 | } |
| 2771 | try { |
| 2772 | return canonical(encoded) |
| 2773 | } catch (leaf) { |
| 2774 | throw new Error( |
| 2775 | "[Query] " + quote(name) + |
| 2776 | ": the encoded args hold a value JSON can't carry (" + |
| 2777 | (leaf instanceof NonJsonLeaf ? leaf.kind : "unknown") + |
| 2778 | "). Give the args Schema a JSON encoding.", |
| 2779 | { cause: leaf } |
| 2780 | ) |
| 2781 | } |
| 2782 | } |
| 2783 | const logKey = (value: unknown, key: string): string => { |
| 2784 | const encode = encodeLogArgs() |
| 2785 | if (encode === undefined) return key |
nothing calls this directly
no test coverage detected