codekingpro/portable-devtools
115k
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 */
16import Diff from './diff/base.js';
17import { diffChars, characterDiff } from './diff/character.js';
18import { diffWords, diffWordsWithSpace, wordDiff, wordsWithSpaceDiff } from './diff/word.js';
19import { diffLines, diffTrimmedLines, lineDiff } from './diff/line.js';
20import { diffSentences, sentenceDiff } from './diff/sentence.js';
21import { diffCss, cssDiff } from './diff/css.js';
22import { diffJson, canonicalize, jsonDiff } from './diff/json.js';
23import { diffArrays, arrayDiff } from './diff/array.js';
24import { applyPatch, applyPatches } from './patch/apply.js';
25import { parsePatch } from './patch/parse.js';
26import { reversePatch } from './patch/reverse.js';
27import { structuredPatch, createTwoFilesPatch, createPatch, formatPatch, INCLUDE_HEADERS, FILE_HEADERS_ONLY, OMIT_HEADERS } from './patch/create.js';
28import { convertChangesToDMP } from './convert/dmp.js';
29import { convertChangesToXML } from './convert/xml.js';
30export { Diff, diffChars, characterDiff, diffWords, wordDiff, diffWordsWithSpace, wordsWithSpaceDiff, diffLines, lineDiff, diffTrimmedLines, diffSentences, sentenceDiff, diffCss, cssDiff, diffJson, jsonDiff, diffArrays, arrayDiff, structuredPatch, createTwoFilesPatch, createPatch, formatPatch, INCLUDE_HEADERS, FILE_HEADERS_ONLY, OMIT_HEADERS, applyPatch, applyPatches, parsePatch, reversePatch, convertChangesToDMP, convertChangesToXML, canonicalize };
31 