MCPcopy Create free account
hub / github.com/deployd/deployd / colorDiffText

Function colorDiffText

test-app/public/sinon.js:2226–2240  ·  view source on GitHub ↗
(diff)

Source from the content-addressed store, hash-verified

2224 }
2225
2226 function colorDiffText(diff) {
2227 var objects = map(diff, function(part) {
2228 var text = part.value;
2229 if (part.added) {
2230 text = color.green(text);
2231 } else if (part.removed) {
2232 text = color.red(text);
2233 }
2234 if (diff.length === 2) {
2235 text += " "; // format simple diffs
2236 }
2237 return text;
2238 });
2239 return join(objects, "");
2240 }
2241
2242 module.exports = {
2243 c: function(spyInstance) {

Callers 1

sinon.jsFile · 0.85

Calls 2

mapFunction · 0.85
joinFunction · 0.85

Tested by

no test coverage detected