MCPcopy Create free account
hub / github.com/play-co/devkit / quote

Function quote

src/util/stringify.js:63–78  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

61
62
63function quote(string) {
64
65 // If the string contains no control characters, no quote characters, and no
66 // backslash characters, then we can safely slap some quotes around it.
67 // Otherwise we must also replace the offending characters with safe escape
68 // sequences.
69
70 escapable.lastIndex = 0;
71 return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
72 var c = meta[a];
73 return typeof c === 'string'
74 ? c
75 : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
76 }) + '"' : '"' + string + '"';
77
78}
79
80function str(key, holder) {
81

Callers 1

strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…