MCPcopy Index your code
hub / github.com/deployd/deployd / errorDiff

Function errorDiff

test-app/public/mocha.js:2262–2275  ·  view source on GitHub ↗

* Return a character diff for `err`. * * @api private * @param {String} actual * @param {String} expected * @return {string} the diff

(actual, expected)

Source from the content-addressed store, hash-verified

2260 * @return {string} the diff
2261 */
2262 function errorDiff(actual, expected) {
2263 return diff
2264 .diffWordsWithSpace(actual, expected)
2265 .map(function(str) {
2266 if (str.added) {
2267 return colorLines('diff added', str.value);
2268 }
2269 if (str.removed) {
2270 return colorLines('diff removed', str.value);
2271 }
2272 return str.value;
2273 })
2274 .join('');
2275 }
2276
2277 /**
2278 * Color lines for `str`, using the color `name`.

Callers 1

inlineDiffFunction · 0.85

Calls 1

colorLinesFunction · 0.85

Tested by

no test coverage detected