MCPcopy Create free account
hub / github.com/unconed/TermKit / quote

Function quote

Node/shell/meta.js:24–32  ·  view source on GitHub ↗
(string)

Source from the content-addressed store, hash-verified

22
23// Quote a string
24function quote(string) {
25 if (/[\u0080-\uFFFF]/(string)) {
26 // TODO: RFC2047 mime encoded tokens.
27 }
28 if (/[ ()<>@,;:\\"\[\]?=]/(string)) {
29 return '"' + string.replace(/([\\"])/g, '\\$1') + '"';
30 }
31 return string;
32}
33
34/**
35 * Container for header key/values + parameters.

Callers 1

meta.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected