MCPcopy Index your code
hub / github.com/ScriptedAlchemy/devtools-debugger-mcp / toCondition

Function toCondition

src/index.ts:243–247  ·  view source on GitHub ↗
(msg: string)

Source from the content-addressed store, hash-verified

241 async (params) => {
242 if (!nodeDebugClient) return { content: [{ type: 'text', text: 'Error: No active debug session.' }], isError: true };
243 const toCondition = (msg: string) => {
244 // Replace {expr} with ${expr} inside a template literal
245 const tpl = '`' + msg.replace(/`/g, '\\`').replace(/\{([^}]+)\}/g, '${$1}') + '`';
246 return `console.log(${tpl}); false`;
247 };
248 try {
249 const condition = toCondition(params.message);
250 const lineNumber = params.line - 1;

Callers 1

index.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected