MCPcopy Index your code
hub / github.com/nodejs/node / parseProbeTarget

Function parseProbeTarget

lib/internal/debugger/inspect_probe.js:113–126  ·  view source on GitHub ↗

* @param {string} text Raw `--probe` argument. * @returns {ProbeTarget}

(text)

Source from the content-addressed store, hash-verified

111 * @returns {ProbeTarget}
112 */
113function 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
128function formatTargetText(target) {
129 const { suffix, line, column } = target;

Callers 1

parseProbeTokensFunction · 0.85

Calls 1

parseUnsignedIntegerFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…