MCPcopy Create free account
hub / github.com/coder/mux / stripOuterQuotes

Function stripOuterQuotes

src/node/services/tools/bash.ts:163–176  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

161type SearchCommand = "rg" | "grep";
162
163function stripOuterQuotes(token: string): string {
164 const trimmed = token.trim();
165 if (trimmed.length < 2) {
166 return trimmed;
167 }
168
169 const first = trimmed[0];
170 const last = trimmed[trimmed.length - 1];
171 if ((first === "'" && last === "'") || (first === '"' && last === '"')) {
172 return trimmed.slice(1, -1);
173 }
174
175 return trimmed;
176}
177
178function isMatchAllSearchPattern(pattern: string): boolean {
179 // Intentionally narrow: we only want to warn on obvious whole-file dump patterns

Callers 2

detectRipgrepFileDumpFunction · 0.70
detectGrepFileDumpFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected