MCPcopy Index your code
hub / github.com/microsoft/typescript-go / EscapeString

Function EscapeString

internal/printer/utilities.go:178–183  ·  view source on GitHub ↗
(s string, quoteChar QuoteChar)

Source from the content-addressed store, hash-verified

176}
177
178func EscapeString(s string, quoteChar QuoteChar) string {
179 var b strings.Builder
180 b.Grow(len(s) + 2)
181 escapeStringWorker(s, quoteChar, getLiteralTextFlagsNeverAsciiEscape, &b)
182 return b.String()
183}
184
185func escapeNonAsciiString(s string, quoteChar QuoteChar) string {
186 var b strings.Builder

Callers 6

getLiteralTextMethod · 0.92
getTextOfNameFunction · 0.92
ValueToStringFunction · 0.92
getLiteralTextOfNodeMethod · 0.85
TestEscapeStringFunction · 0.85

Calls 4

lenFunction · 0.85
escapeStringWorkerFunction · 0.85
GrowMethod · 0.80
StringMethod · 0.65

Tested by 1

TestEscapeStringFunction · 0.68