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

Function encodeCollected

packages/effect/src/ui/MessageLog.ts:1539–1551  ·  view source on GitHub ↗
(
    component: Component.Mountable.Any,
    collected: ReadonlyArray<unknown> | undefined
  )

Source from the content-addressed store, hash-verified

1537 return { shared: cap(out) }
1538 }
1539 const encodeCollected = (
1540 component: Component.Mountable.Any,
1541 collected: ReadonlyArray<unknown> | undefined
1542 ): { readonly collected?: Schema.Json } =>
1543 collected === undefined ? {} : {
1544 collected: cap(
1545 encodeWith(
1546 sharedReads.reportsSchemaOf(component.definition),
1547 `${component.definition.name}.collects`,
1548 collected
1549 ) as Schema.Json
1550 )
1551 }
1552 // A message can carry a query's whole result, so messages are capped like Models and query results.
1553 const capped = (
1554 component: Component.Mountable.Any,

Callers 1

encodeFunction · 0.85

Calls 2

capFunction · 0.85
encodeWithFunction · 0.85

Tested by

no test coverage detected