MCPcopy Index your code
hub / github.com/simstudioai/sim / blankStringsAndComments

Function blankStringsAndComments

scripts/generate-docs.ts:593–598  ·  view source on GitHub ↗

* Length-preserving copy of `content` with string-literal and comment * interiors blanked out, so delimiter scans cannot be tripped by braces or * quotes inside them. Indices into the result line up with indices into * `content`.

(content: string)

Source from the content-addressed store, hash-verified

591 * `content`.
592 */
593function blankStringsAndComments(content: string): string {
594 return content.replace(
595 /(['"`])(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\/[^\n]*|\/\*[\s\S]*?\*\//g,
596 (match) => match[0] + match.slice(1, -1).replace(/[^\n]/g, ' ') + match[match.length - 1]
597 )
598}
599
600/**
601 * Extract the OAuth service id from the block's `oauth-input` credential

Callers 1

extractOAuthServiceIdFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected