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

Function printSimpleMyersDiff

lib/internal/assert/myers_diff.js:127–144  ·  view source on GitHub ↗
(diff)

Source from the content-addressed store, hash-verified

125}
126
127function printSimpleMyersDiff(diff) {
128 let message = '';
129
130 for (let diffIdx = diff.length - 1; diffIdx >= 0; diffIdx--) {
131 const { 0: operation, 1: value } = diff[diffIdx];
132 let color = colors.white;
133
134 if (operation === kOperations.INSERT) {
135 color = colors.green;
136 } else if (operation === kOperations.DELETE) {
137 color = colors.red;
138 }
139
140 message += `${color}${value}${colors.white}`;
141 }
142
143 return `\n${message}`;
144}
145
146function printMyersDiff(diff, operator) {
147 let message = '';

Callers 1

getColoredMyersDiffFunction · 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…