(writer: BinaryWriter, op: WriteOp)
| 78 | } |
| 79 | |
| 80 | function 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 | |
| 100 | function assertBinaryError(err: unknown, code: "ZR_MISALIGNED" | "ZR_LIMIT"): boolean { |
| 101 | assert.ok(err instanceof ZrBinaryError); |
no test coverage detected