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

Function packedSize

packages/effect/src/encoding/SchemaBinary.ts:2131–2147  ·  view source on GitHub ↗
(layout: Layout)

Source from the content-addressed store, hash-verified

2129}
2130
2131function packedSize(layout: Layout): number | undefined {
2132 switch (layout._) {
2133 case "literal":
2134 return packedSize(layout.leaf)
2135 case "bool":
2136 return 1
2137 case "i32":
2138 case "u32":
2139 return 4
2140 case "int64":
2141 case "i64":
2142 case "u64":
2143 return 8
2144 default:
2145 return undefined
2146 }
2147}
2148
2149function isInlineSlot(layout: Layout): boolean {
2150 return packedSize(layout) !== undefined || isSelfDelimiting(layout) ||

Callers 3

isInlineSlotFunction · 0.85
compileArrayFunction · 0.85
decodeSlotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected