(source: Source)
| 1829 | }) |
| 1830 | |
| 1831 | const encodeSource = (source: Source): typeof SourceWire.Type => { |
| 1832 | switch (source._tag) { |
| 1833 | case "Command": |
| 1834 | return { |
| 1835 | ...source, |
| 1836 | spanId: source.spanId ?? null, |
| 1837 | traceId: source.traceId ?? null |
| 1838 | } |
| 1839 | case "Mount": |
| 1840 | return { |
| 1841 | _tag: "Mount", |
| 1842 | name: source.name, |
| 1843 | seq: source.seq, |
| 1844 | args: encodeArgs(source.argsSchema, source.args) |
| 1845 | } |
| 1846 | case "Subscription": |
| 1847 | return { _tag: "Subscription", ...encodeSubscription(source) } |
| 1848 | default: |
| 1849 | return source |
| 1850 | } |
| 1851 | } |
| 1852 | |
| 1853 | /** |
| 1854 | * Encodes a Command by name, group and args. Args and group fields use the |
no test coverage detected