MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / escapeRegExp

Function escapeRegExp

packages/plugins/mcp/src/sdk/invoke.ts:53–53  ·  view source on GitHub ↗
(value: string)

Source from the content-addressed store, hash-verified

51// keep a domain error that merely mentions "not found" from matching. A miss
52// is benign (the catalog still heals via TTL or explicit refresh).
53const escapeRegExp = (value: string): string => value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
54
55export const isUnknownToolMessage = (message: string, toolName: string): boolean => {
56 const name = escapeRegExp(toolName);

Callers 1

isUnknownToolMessageFunction · 0.70

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected