/
githubmirror
/
node
Обзор
Документация
Войти
/
githubmirror
/
node
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
deps/npm/node_modules/diff/libcjs/convert/dmp.js
24 строки
699 B
npm CLI robot
deps: upgrade npm to 11.6.1
03 окт 2025, 01:30
Не верифицирован
03 окт 2025, 01:30
5d843c9
Код
Авторство
О чём код?
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.convertChangesToDMP = convertChangesToDMP; /** * converts a list of change objects to the format returned by Google's [diff-match-patch](https://github.com/google/diff-match-patch) library */ function convertChangesToDMP(changes) { var ret = []; var change, operation; for (var 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; }