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

Function urlMatchesToken

packages/plugins/mcp/src/sdk/plugin.ts:597–600  ·  view source on GitHub ↗
(url: URL, token: string)

Source from the content-addressed store, hash-verified

595/** Match `token` as a separator-bounded run inside a URL hostname or path,
596 * used as a low-confidence detection hint when wire-shape detection fails. */
597const urlMatchesToken = (url: URL, token: string): boolean => {
598 const re = new RegExp(`(?:^|[^a-z0-9])${token}(?:$|[^a-z0-9])`, "i");
599 return re.test(url.hostname) || re.test(url.pathname);
600};
601
602/** Translate a hard-stop probe outcome into a message a user can act on.
603 * Auth-required shapes are routed to the auth editor upstream, so they never

Callers 1

plugin.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected