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

Function encodeSubscription

packages/effect/src/ui/MessageLog.ts:1817–1829  ·  view source on GitHub ↗
(
  subscription: {
    readonly key: string
    readonly name: string
    readonly deps: ReadonlyArray<Subscription.Dep> | undefined
  }
)

Source from the content-addressed store, hash-verified

1815
1816// JSON has no `-0`, and `structural` has the placeholder for a number that isn't finite.
1817const encodeSubscription = (
1818 subscription: {
1819 readonly key: string
1820 readonly name: string
1821 readonly deps: ReadonlyArray<Subscription.Dep> | undefined
1822 }
1823) => ({
1824 key: subscription.key,
1825 name: subscription.name,
1826 deps: subscription.deps === undefined
1827 ? null
1828 : subscription.deps.map((dep) => dep === 0 ? 0 : structural(dep))
1829})
1830
1831const encodeSource = (source: Source): typeof SourceWire.Type => {
1832 switch (source._tag) {

Callers 2

encodeFunction · 0.85
encodeSourceFunction · 0.85

Calls 2

structuralFunction · 0.85
mapMethod · 0.45

Tested by

no test coverage detected