(cmd: string)
| 126 | * @internal Exported for testing |
| 127 | */ |
| 128 | export function isPrintCommand(cmd: string): boolean { |
| 129 | if (!cmd) return false |
| 130 | // Single strict regex that only matches allowed print commands |
| 131 | // ^(?:\d+|\d+,\d+)?p$ matches: p, 1p, 123p, 1,5p, 10,200p |
| 132 | return /^(?:\d+|\d+,\d+)?p$/.test(cmd) |
| 133 | } |
| 134 | |
| 135 | /** |
| 136 | * Pattern 2: Check if this is a substitution command |
no outgoing calls
no test coverage detected