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

Function isInsideString

scripts/generate-docs.ts:1864–1886  ·  view source on GitHub ↗
(content: string, position: number)

Source from the content-addressed store, hash-verified

1862 * This prevents matching patterns like "Example: {" inside description strings.
1863 */
1864 const isInsideString = (content: string, position: number): boolean => {
1865 let inSingleQuote = false
1866 let inDoubleQuote = false
1867 let inBacktick = false
1868
1869 for (let i = 0; i < position; i++) {
1870 const char = content[i]
1871 const prevChar = i > 0 ? content[i - 1] : ''
1872
1873 // Skip escaped quotes
1874 if (prevChar === '\\') continue
1875
1876 if (char === "'" && !inDoubleQuote && !inBacktick) {
1877 inSingleQuote = !inSingleQuote
1878 } else if (char === '"' && !inSingleQuote && !inBacktick) {
1879 inDoubleQuote = !inDoubleQuote
1880 } else if (char === '`' && !inSingleQuote && !inDoubleQuote) {
1881 inBacktick = !inBacktick
1882 }
1883 }
1884
1885 return inSingleQuote || inDoubleQuote || inBacktick
1886 }
1887
1888 while ((paramMatch = paramBlocksRegex.exec(paramsContent)) !== null) {
1889 const paramName = paramMatch[1]

Callers 1

extractToolInfoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected