(arg: string)
| 22 | } |
| 23 | |
| 24 | function parseBlockIdArg(arg: string): number | null { |
| 25 | const normalized = arg.trim().toLowerCase() |
| 26 | const blockRef = parseBlockRef(normalized) |
| 27 | if (blockRef !== null) { |
| 28 | return blockRef |
| 29 | } |
| 30 | |
| 31 | if (!/^[1-9]\d*$/.test(normalized)) { |
| 32 | return null |
| 33 | } |
| 34 | |
| 35 | const parsed = Number.parseInt(normalized, 10) |
| 36 | return Number.isInteger(parsed) && parsed > 0 ? parsed : null |
| 37 | } |
| 38 | |
| 39 | function findActiveParentBlockId( |
| 40 | messagesState: PruneMessagesState, |
no test coverage detected