index.js 1.8 KB

123456789101112131415161718192021222324252627282930
  1. /* See LICENSE file for terms of use */
  2. /*
  3. * Text diff implementation.
  4. *
  5. * This library supports the following APIs:
  6. * Diff.diffChars: Character by character diff
  7. * Diff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
  8. * Diff.diffLines: Line based diff
  9. *
  10. * Diff.diffCss: Diff targeted at CSS content
  11. *
  12. * These methods are based on the implementation proposed in
  13. * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
  14. * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
  15. */
  16. import Diff from './diff/base.js';
  17. import { diffChars, characterDiff } from './diff/character.js';
  18. import { diffWords, diffWordsWithSpace, wordDiff, wordsWithSpaceDiff } from './diff/word.js';
  19. import { diffLines, diffTrimmedLines, lineDiff } from './diff/line.js';
  20. import { diffSentences, sentenceDiff } from './diff/sentence.js';
  21. import { diffCss, cssDiff } from './diff/css.js';
  22. import { diffJson, canonicalize, jsonDiff } from './diff/json.js';
  23. import { diffArrays, arrayDiff } from './diff/array.js';
  24. import { applyPatch, applyPatches } from './patch/apply.js';
  25. import { parsePatch } from './patch/parse.js';
  26. import { reversePatch } from './patch/reverse.js';
  27. import { structuredPatch, createTwoFilesPatch, createPatch, formatPatch } from './patch/create.js';
  28. import { convertChangesToDMP } from './convert/dmp.js';
  29. import { convertChangesToXML } from './convert/xml.js';
  30. export { Diff, diffChars, characterDiff, diffWords, wordDiff, diffWordsWithSpace, wordsWithSpaceDiff, diffLines, lineDiff, diffTrimmedLines, diffSentences, sentenceDiff, diffCss, cssDiff, diffJson, jsonDiff, diffArrays, arrayDiff, structuredPatch, createTwoFilesPatch, createPatch, formatPatch, applyPatch, applyPatches, parsePatch, reversePatch, convertChangesToDMP, convertChangesToXML, canonicalize };