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

Function tapEscape

lib/internal/test_runner/reporter/tap.js:128–138  ·  view source on GitHub ↗
(input)

Source from the content-addressed store, hash-verified

126
127// In certain places, # and \ need to be escaped as \# and \\.
128function tapEscape(input) {
129 let result = StringPrototypeReplaceAll(input, '\b', '\\b');
130 result = StringPrototypeReplaceAll(result, '\f', '\\f');
131 result = StringPrototypeReplaceAll(result, '\t', '\\t');
132 result = StringPrototypeReplaceAll(result, '\n', '\\n');
133 result = StringPrototypeReplaceAll(result, '\r', '\\r');
134 result = StringPrototypeReplaceAll(result, '\v', '\\v');
135 result = StringPrototypeReplaceAll(result, '\\', '\\\\');
136 result = StringPrototypeReplaceAll(result, '#', '\\#');
137 return result;
138}
139
140function jsToYaml(indent, name, value, seen) {
141 if (value === undefined) {

Callers 2

tapReporterFunction · 0.85
reportTestFunction · 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…