MCPcopy
hub / github.com/CodeboxIDE/codebox / quote

Function quote

client/vendors/socket.io.js:698–711  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

696
697
698 function quote(string) {
699
700// If the string contains no control characters, no quote characters, and no
701// backslash characters, then we can safely slap some quotes around it.
702// Otherwise we must also replace the offending characters with safe escape
703// sequences.
704
705 escapable.lastIndex = 0;
706 return escapable.test(string) ? '"' + string.replace(escapable, function (a) {
707 var c = meta[a];
708 return typeof c === 'string' ? c :
709 '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
710 }) + '"' : '"' + string + '"';
711 }
712
713
714 function str(key, holder) {

Callers 1

strFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected