chore: resolve eslint warnings in packages/mermaid/src/diagrams/packet/parser.ts

This commit is contained in:
Sidharth Vinod
2025-04-19 10:21:45 +05:30
parent 6d8b936319
commit cfe1723c6c

View File

@@ -50,9 +50,7 @@ const getNextFittingBlock = (
row: number,
bitsPerRow: number
): [Required<PacketBlock>, PacketBlock | undefined] => {
if (block.end === undefined) {
block.end = block.start;
}
block.end ??= block.start;
if (block.start > block.end) {
throw new Error(`Block start ${block.start} is greater than block end ${block.end}.`);