(index: number)
| 22 | } |
| 23 | |
| 24 | export function formatMessageRef(index: number): string { |
| 25 | if ( |
| 26 | !Number.isInteger(index) || |
| 27 | index < MESSAGE_REF_MIN_INDEX || |
| 28 | index > MESSAGE_REF_MAX_INDEX |
| 29 | ) { |
| 30 | throw new Error( |
| 31 | `Message ID index out of bounds: ${index}. Supported range is 0-${MESSAGE_REF_MAX_INDEX}.`, |
| 32 | ) |
| 33 | } |
| 34 | return `m${index.toString().padStart(MESSAGE_REF_WIDTH, "0")}` |
| 35 | } |
| 36 | |
| 37 | export function formatBlockRef(blockId: number): string { |
| 38 | if (!Number.isInteger(blockId) || blockId < 1) { |
no outgoing calls
no test coverage detected