/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/npm/node_modules/diff/libesm/convert/dmp.js
21 строка
580 B
npm CLI robot
deps: upgrade npm to 11.6.1
03 окт 2025, 01:30
Не верифицирован
03 окт 2025, 01:30
5d843c9
Код
Авторство
О чём код?
/** * converts a list of change objects to the format returned by Google's [diff-match-patch](https://github.com/google/diff-match-patch) library */ export function convertChangesToDMP(changes) { const ret = []; let change, operation; for (let i = 0; i < changes.length; i++) { change = changes[i]; if (change.added) { operation = 1; } else if (change.removed) { operation = -1; } else { operation = 0; } ret.push([operation, change.value]); } return ret; }