MCPcopy Create free account
hub / github.com/Effect-TS/effect / encodeSource

Function encodeSource

packages/effect/src/ui/MessageLog.ts:1831–1851  ·  view source on GitHub ↗
(source: Source)

Source from the content-addressed store, hash-verified

1829})
1830
1831const 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

Callers 1

encodeFunction · 0.85

Calls 2

encodeArgsFunction · 0.85
encodeSubscriptionFunction · 0.85

Tested by

no test coverage detected