MCPcopy Index your code
hub / github.com/TanStack/devtools / escapeForStringLiteral

Function escapeForStringLiteral

packages/devtools-vite/src/enhance-logs.ts:8–10  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

6import { walk } from './ast-utils'
7
8function escapeForStringLiteral(str: string): string {
9 return str.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\n/g, '\\n')
10}
11
12export function enhanceConsoleLog(code: string, id: string, port: number) {
13 const filePath = id.split('?')[0]!

Callers 1

enhanceConsoleLogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected