* @param {string} text Raw `--probe` argument. * @returns {ProbeTarget}
(text)
| 111 | * @returns {ProbeTarget} |
| 112 | */ |
| 113 | function parseProbeTarget(text) { |
| 114 | // Accepts file:line or file:line:column formats. |
| 115 | // Non-greedy (.+?) allows Windows drive-letter paths like C:\foo.js:10. |
| 116 | const match = RegExpPrototypeExec(/^(.+?):(\d+)(?::(\d+))?$/, text); |
| 117 | if (match === null) { |
| 118 | throw new ERR_DEBUGGER_STARTUP_ERROR(`Invalid probe location: ${text}`); |
| 119 | } |
| 120 | |
| 121 | const suffix = match[1]; |
| 122 | const line = parseUnsignedInteger(match[2], 'probe location'); |
| 123 | // Column is left as undefined if the user does not supply one. |
| 124 | const column = match[3] !== undefined ? parseUnsignedInteger(match[3], 'probe location') : undefined; |
| 125 | return { suffix, line, column }; |
| 126 | } |
| 127 | |
| 128 | function formatTargetText(target) { |
| 129 | const { suffix, line, column } = target; |
no test coverage detected
searching dependent graphs…