MCPcopy
hub / github.com/benjamn/recast / jsSafeStringify

Function jsSafeStringify

lib/printer.ts:3084–3088  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

3082}
3083
3084function jsSafeStringify(str: string) {
3085 return JSON.stringify(str).replace(/[\u2028\u2029]/g, function (m) {
3086 return "\\u" + m.charCodeAt(0).toString(16);
3087 });
3088}
3089
3090function nodeStr(str: string, options: any) {
3091 isString.assert(str);

Callers 1

nodeStrFunction · 0.85

Calls 2

replaceMethod · 0.80
toStringMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…