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

Function decodeSlot

packages/effect/src/encoding/SchemaBinary.ts:4438–4447  ·  view source on GitHub ↗
(layout: Layout, r: Reader)

Source from the content-addressed store, hash-verified

4436}
4437
4438function decodeSlot(layout: Layout, r: Reader): unknown {
4439 if (isSelfDelimiting(layout)) return decodeValue(layout, r)
4440 const size = packedSize(layout)
4441 const saved = r.enter(
4442 size !== undefined ? size : layout._ === "null" || layout._ === "undefined" ? 0 : r.uvarint()
4443 )
4444 const value = decodeChecked(layout, r)
4445 r.exit(saved)
4446 return value
4447}
4448
4449// Records are usually small, so duplicate keys scan a list and only wide
4450// records spill into a set.

Callers 2

decodeStructPositionalFunction · 0.85
decodeArrayFunction · 0.85

Calls 7

isSelfDelimitingFunction · 0.85
packedSizeFunction · 0.85
decodeCheckedFunction · 0.85
enterMethod · 0.80
exitMethod · 0.80
decodeValueFunction · 0.70
uvarintMethod · 0.45

Tested by

no test coverage detected