MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / applyWriter

Function applyWriter

packages/core/src/binary/__tests__/binary.fuzz.test.ts:80–98  ·  view source on GitHub ↗
(writer: BinaryWriter, op: WriteOp)

Source from the content-addressed store, hash-verified

78}
79
80function applyWriter(writer: BinaryWriter, op: WriteOp): void {
81 if (op.kind === "u8") {
82 writer.writeU8(op.value);
83 return;
84 }
85 if (op.kind === "u32") {
86 writer.writeU32(op.value);
87 return;
88 }
89 if (op.kind === "i32") {
90 writer.writeI32(op.value);
91 return;
92 }
93 if (op.kind === "bytes") {
94 writer.writeBytes(op.bytes);
95 return;
96 }
97 writer.padTo4();
98}
99
100function assertBinaryError(err: unknown, code: "ZR_MISALIGNED" | "ZR_LIMIT"): boolean {
101 assert.ok(err instanceof ZrBinaryError);

Callers 1

Calls 5

writeU8Method · 0.80
writeU32Method · 0.80
writeI32Method · 0.80
writeBytesMethod · 0.80
padTo4Method · 0.80

Tested by

no test coverage detected