MCPcopy Index your code
hub / github.com/nodejs/node / escapeQuoteOrSolidus

Function escapeQuoteOrSolidus

lib/internal/mime.js:109–116  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

107
108
109function escapeQuoteOrSolidus(str) {
110 let result = '';
111 for (let i = 0; i < str.length; i++) {
112 const char = str[i];
113 result += (char === '"' || char === '\\') ? `\\${char}` : char;
114 }
115 return result;
116}
117
118const encode = (value) => {
119 if (value.length === 0) return '""';

Callers 1

encodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected