MCPcopy Index your code
hub / github.com/caolan/nodeunit / quote

Function quote

examples/browser/nodeunit.js:220–235  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

218
219
220 function quote(string) {
221
222// If the string contains no control characters, no quote characters, and no
223// backslash characters, then we can safely slap some quotes around it.
224// Otherwise we must also replace the offending characters with safe escape
225// sequences.
226
227 escapable.lastIndex = 0;
228 return escapable.test(string) ?
229 '"' + string.replace(escapable, function (a) {
230 var c = meta[a];
231 return typeof c === 'string' ? c :
232 '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
233 }) + '"' :
234 '"' + string + '"';
235 }
236
237
238 function str(key, holder) {

Callers 1

strFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…