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

Function positionalRunShape

packages/effect/src/encoding/SchemaBinary.ts:4813–4826  ·  view source on GitHub ↗
(struct: StructLayout, r: Reader)

Source from the content-addressed store, hash-verified

4811
4812// A positional shape is the presence mask over layout field order.
4813function positionalRunShape(struct: StructLayout, r: Reader): Array<RunSlot> {
4814 const mask = r.uvarint()
4815 const fields = struct.fields
4816 const fieldBits = mask & ~RUN_EXTRA_BIT
4817 if (mask > RUN_EXTRA_BIT * 2 - 1 || (fieldBits >>> fields.length) !== 0) {
4818 invalid("a known row shape", undefined, r.options)
4819 }
4820 const shape: Array<RunSlot> = []
4821 if ((mask & RUN_EXTRA_BIT) !== 0) shape.push(null)
4822 for (let i = 0; i < fields.length; i++) {
4823 if ((fieldBits & (1 << i)) !== 0) shape.push(fields[i])
4824 }
4825 return shape
4826}
4827
4828function decodeRunRow(
4829 plan: RunPlan,

Callers 1

decodeRunRowFunction · 0.85

Calls 3

invalidFunction · 0.70
pushMethod · 0.65
uvarintMethod · 0.45

Tested by

no test coverage detected