diff options
Diffstat (limited to 'desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines')
36 files changed, 485 insertions, 0 deletions
diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.d.ts new file mode 100644 index 0000000..9f3985b --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.d.ts @@ -0,0 +1,36 @@ +import { BufferPair } from '../../fs/BufferPool'; +interface RestPair { + rest1: string; + rest2: string; +} +interface RestLines { + restLines1: string[]; + restLines2: string[]; +} +export declare class LineBasedCompareContext { + /** + * File to compare. + */ + fd1: number; + /** + * File to compare. + */ + fd2: number; + /** + * Buffers used as temporary storage. + */ + buffer: BufferPair; + /** + * Part of a line that was split at buffer boundary in a previous read. + * Will be prefixed to the next read. + */ + rest: RestPair; + /** + * Lines that remain unprocessed from a previous read. + * Will be prefixed to the next read. + */ + restLines: RestLines; + constructor(fd1: number, fd2: number, bufferPair: BufferPair); +} +export {}; +//# sourceMappingURL=LineBasedCompareContext.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.d.ts.map new file mode 100644 index 0000000..61af3b3 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LineBasedCompareContext.d.ts","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/LineBasedCompareContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAEhD,UAAU,QAAQ;IACd,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CAChB;AAED,UAAU,SAAS;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,UAAU,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,qBAAa,uBAAuB;IAChC;;OAEG;IACI,GAAG,EAAE,MAAM,CAAA;IAClB;;OAEG;IACI,GAAG,EAAE,MAAM,CAAA;IAClB;;OAEG;IACI,MAAM,EAAE,UAAU,CAAA;IACzB;;;OAGG;IACI,IAAI,EAAE,QAAQ,CAAyB;IAC9C;;;OAGG;IACI,SAAS,EAAE,SAAS,CAAmC;gBAElD,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU;CAK/D"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.js new file mode 100644 index 0000000..4ed51ef --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LineBasedCompareContext = void 0; +class LineBasedCompareContext { + constructor(fd1, fd2, bufferPair) { + /** + * Part of a line that was split at buffer boundary in a previous read. + * Will be prefixed to the next read. + */ + this.rest = { rest1: '', rest2: '' }; + /** + * Lines that remain unprocessed from a previous read. + * Will be prefixed to the next read. + */ + this.restLines = { restLines1: [], restLines2: [] }; + this.fd1 = fd1; + this.fd2 = fd2; + this.buffer = bufferPair; + } +} +exports.LineBasedCompareContext = LineBasedCompareContext; +//# sourceMappingURL=LineBasedCompareContext.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.js.map new file mode 100644 index 0000000..1f2954d --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/LineBasedCompareContext.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LineBasedCompareContext.js","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/LineBasedCompareContext.ts"],"names":[],"mappings":";;;AAYA,MAAa,uBAAuB;IAwBhC,YAAY,GAAW,EAAE,GAAW,EAAE,UAAsB;QAX5D;;;WAGG;QACI,SAAI,GAAa,EAAC,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAC,CAAA;QAC9C;;;WAGG;QACI,cAAS,GAAc,EAAC,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAC,CAAA;QAG1D,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,GAAG,GAAG,GAAG,CAAA;QACd,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;IAC5B,CAAC;CACJ;AA7BD,0DA6BC"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.d.ts new file mode 100644 index 0000000..e826dd0 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.d.ts @@ -0,0 +1,15 @@ +export interface CompareLinesResult { + /** + * Whether compared lines are identical. + */ + isEqual: boolean; + /** + * Lines that were not compared due to unbalanced buffers. + */ + restLines1: string[]; + /** + * Lines that were not compared due to unbalanced buffers. + */ + restLines2: string[]; +} +//# sourceMappingURL=CompareLinesResult.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.d.ts.map new file mode 100644 index 0000000..fa1fdd2 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CompareLinesResult.d.ts","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/compare/CompareLinesResult.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB;;OAEG;IACH,UAAU,EAAE,MAAM,EAAE,CAAA;CACvB"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.js new file mode 100644 index 0000000..3f82bd6 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=CompareLinesResult.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.js.map new file mode 100644 index 0000000..0500c02 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/CompareLinesResult.js.map @@ -0,0 +1 @@ +{"version":3,"file":"CompareLinesResult.js","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/compare/CompareLinesResult.ts"],"names":[],"mappings":""}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.d.ts new file mode 100644 index 0000000..1c49810 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.d.ts @@ -0,0 +1,27 @@ +import { Options } from '../../../index'; +import { LineBatch } from '../lineReader/LineBatch'; +interface RestLines { + restLines1: string[]; + restLines2: string[]; +} +interface CompareLineBatchResult { + reachedEof: boolean; + batchIsEqual: boolean; + /** + * Lines that were not compared because the two line batches + * contained different number of lines. + * These remaining lines will be compared in the next step. + */ + restLines: RestLines; +} +/** + * Compares two batches of lines. + * + * @param lineBatch1 Batch to compare. + * @param lineBatch2 Batch to compare. + * @param context Comparison context. + * @param options Comparison options. + */ +export declare function compareLineBatches(lineBatch1: LineBatch, lineBatch2: LineBatch, options: Options): CompareLineBatchResult; +export {}; +//# sourceMappingURL=compareLineBatches.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.d.ts.map new file mode 100644 index 0000000..6697bc4 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compareLineBatches.d.ts","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/compare/compareLineBatches.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGnD,UAAU,SAAS;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,UAAU,EAAE,MAAM,EAAE,CAAA;CACvB;AAED,UAAU,sBAAsB;IAC5B,UAAU,EAAE,OAAO,CAAA;IACnB,YAAY,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,SAAS,EAAE,SAAS,CAAA;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,sBAAsB,CAuBzH"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.js new file mode 100644 index 0000000..26b377d --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.compareLineBatches = void 0; +const compareLines_1 = require("./compareLines"); +/** + * Compares two batches of lines. + * + * @param lineBatch1 Batch to compare. + * @param lineBatch2 Batch to compare. + * @param context Comparison context. + * @param options Comparison options. + */ +function compareLineBatches(lineBatch1, lineBatch2, options) { + const compareResult = compareLines_1.compareLines(lineBatch1.lines, lineBatch2.lines, options); + if (!compareResult.isEqual) { + return { batchIsEqual: false, reachedEof: false, restLines: emptyRestLines() }; + } + const reachedEof = lineBatch1.reachedEof && lineBatch2.reachedEof; + const hasMoreLinesToProcess = compareResult.restLines1.length > 0 || compareResult.restLines2.length > 0; + if (reachedEof && hasMoreLinesToProcess) { + return { batchIsEqual: false, reachedEof: true, restLines: emptyRestLines() }; + } + if (reachedEof) { + return { batchIsEqual: true, reachedEof: true, restLines: emptyRestLines() }; + } + return { batchIsEqual: true, reachedEof: false, + restLines: { + restLines1: compareResult.restLines1, + restLines2: compareResult.restLines2, + } + }; +} +exports.compareLineBatches = compareLineBatches; +function emptyRestLines() { + return { + restLines1: [], + restLines2: [] + }; +} +//# sourceMappingURL=compareLineBatches.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.js.map new file mode 100644 index 0000000..eab6a39 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLineBatches.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compareLineBatches.js","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/compare/compareLineBatches.ts"],"names":[],"mappings":";;;AAEA,iDAA6C;AAkB7C;;;;;;;GAOG;AACH,SAAgB,kBAAkB,CAAC,UAAqB,EAAE,UAAqB,EAAE,OAAgB;IAE7F,MAAM,aAAa,GAAG,2BAAY,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;IAC/E,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE;QACxB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,EAAC,CAAA;KAChF;IAED,MAAM,UAAU,GAAG,UAAU,CAAC,UAAU,IAAI,UAAU,CAAC,UAAU,CAAA;IACjE,MAAM,qBAAqB,GAAG,aAAa,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAA;IACxG,IAAI,UAAU,IAAI,qBAAqB,EAAE;QACrC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAG,SAAS,EAAE,cAAc,EAAE,EAAC,CAAA;KAChF;IAED,IAAI,UAAU,EAAE;QACZ,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAG,SAAS,EAAE,cAAc,EAAE,EAAC,CAAA;KAC/E;IAED,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK;QAC1C,SAAS,EAAE;YACP,UAAU,EAAE,aAAa,CAAC,UAAU;YACpC,UAAU,EAAE,aAAa,CAAC,UAAU;SACvC;KACJ,CAAA;AACL,CAAC;AAvBD,gDAuBC;AAED,SAAS,cAAc;IACnB,OAAO;QACH,UAAU,EAAE,EAAE;QACd,UAAU,EAAE,EAAE;KACjB,CAAA;AACL,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.d.ts new file mode 100644 index 0000000..2519563 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.d.ts @@ -0,0 +1,4 @@ +import { Options } from "../../../index"; +import { CompareLinesResult } from "./CompareLinesResult"; +export declare function compareLines(lines1: string[], lines2: string[], options: Options): CompareLinesResult; +//# sourceMappingURL=compareLines.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.d.ts.map new file mode 100644 index 0000000..83bef63 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compareLines.d.ts","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/compare/compareLines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAMzD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAkBrG"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.js new file mode 100644 index 0000000..132a71e --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.js @@ -0,0 +1,78 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.compareLines = void 0; +const TRIM_WHITE_SPACES_REGEXP = /^[ \f\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+|[ \f\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+$/g; +const TRIM_LINE_ENDING_REGEXP = /\r\n|\n$/g; +const REMOVE_WHITE_SPACES_REGEXP = /[ \f\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]/g; +function compareLines(lines1, lines2, options) { + if (options.ignoreEmptyLines) { + lines1 = removeEmptyLines(lines1); + lines2 = removeEmptyLines(lines2); + } + const len = Math.min(lines1.length, lines2.length); + let i = 0; + for (; i < len; i++) { + const isEqual = compareLine(options, lines1[i], lines2[i]); + if (!isEqual) { + return { isEqual: false, restLines1: [], restLines2: [] }; + } + } + return { + isEqual: true, + restLines1: lines1.slice(i), + restLines2: lines2.slice(i) + }; +} +exports.compareLines = compareLines; +function compareLine(options, line1, line2) { + if (options.ignoreLineEnding) { + line1 = trimLineEnding(line1); + line2 = trimLineEnding(line2); + } + if (options.ignoreWhiteSpaces) { + line1 = trimSpaces(line1); + line2 = trimSpaces(line2); + } + if (options.ignoreAllWhiteSpaces) { + line1 = removeSpaces(line1); + line2 = removeSpaces(line2); + } + return line1 === line2; +} +// Trims string like ' abc \n' into 'abc\n' +function trimSpaces(s) { + const { content, lineEnding } = separateEol(s); + const trimmed = content.replace(TRIM_WHITE_SPACES_REGEXP, ''); + return trimmed + lineEnding; +} +function trimLineEnding(s) { + return s.replace(TRIM_LINE_ENDING_REGEXP, ''); +} +function removeSpaces(s) { + return s.replace(REMOVE_WHITE_SPACES_REGEXP, ''); +} +function removeEmptyLines(lines) { + return lines.filter(line => !isEmptyLine(line)); +} +function isEmptyLine(line) { + return line === '\n' || line === '\r\n'; +} +function separateEol(s) { + const len = s.length; + let lineEnding = ''; + let content = s; + if (s[len - 1] === '\n') { + if (s[len - 2] === '\r') { + return { + lineEnding: '\r\n', + content: s.slice(0, len - 2) + }; + } + { + lineEnding = '\n'; + content = s.slice(0, len - 1); + } + } + return { content, lineEnding }; +} +//# sourceMappingURL=compareLines.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.js.map new file mode 100644 index 0000000..0070f97 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compare/compareLines.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compareLines.js","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/compare/compareLines.ts"],"names":[],"mappings":";;;AAGA,MAAM,wBAAwB,GAAG,oJAAoJ,CAAA;AACrL,MAAM,uBAAuB,GAAG,WAAW,CAAA;AAC3C,MAAM,0BAA0B,GAAG,yEAAyE,CAAA;AAE5G,SAAgB,YAAY,CAAC,MAAgB,EAAE,MAAgB,EAAE,OAAgB;IAC7E,IAAI,OAAO,CAAC,gBAAgB,EAAE;QAC1B,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;QACjC,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAA;KACpC;IACD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAA;IAClD,IAAI,CAAC,GAAG,CAAC,CAAA;IACT,OAAO,CAAC,GAAG,GAAG,EAAE,CAAC,EAAE,EAAE;QACjB,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;QAC1D,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,CAAA;SAC5D;KACJ;IACD,OAAO;QACH,OAAO,EAAE,IAAI;QACb,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9B,CAAA;AACL,CAAC;AAlBD,oCAkBC;AAGD,SAAS,WAAW,CAAC,OAAgB,EAAE,KAAa,EAAE,KAAa;IAC/D,IAAI,OAAO,CAAC,gBAAgB,EAAE;QA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,CAAA;IACpB,IAAI,UAAU,GAAG,EAAE,CAAA;IACnB,IAAI,OAAO,GAAG,CAAC,CAAA;IACf,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;QACrB,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,EAAE;YACrB,OAAO;gBACH,UAAU,EAAE,MAAM;gBAClB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC;aAC/B,CAAA;SACJ;QAED;YACI,UAAU,GAAG,IAAI,CAAA;YACjB,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,CAAC,CAAA;SAChC;KACJ;IACD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAA;AAClC,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.d.ts new file mode 100644 index 0000000..4dae412 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.d.ts @@ -0,0 +1,3 @@ +import { CompareFileAsync } from '../../types'; +export declare const lineBasedCompareAsync: CompareFileAsync; +//# sourceMappingURL=compareAsync.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.d.ts.map new file mode 100644 index 0000000..451e2b7 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compareAsync.d.ts","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/compareAsync.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAQ9C,eAAO,MAAM,qBAAqB,EAAE,gBA+BnC,CAAA"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.js new file mode 100644 index 0000000..f9d6afe --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.js @@ -0,0 +1,75 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lineBasedCompareAsync = void 0; +const FileDescriptorQueue_1 = require("../../fs/FileDescriptorQueue"); +const closeFile_1 = __importDefault(require("../../fs/closeFile")); +const fsPromise_1 = __importDefault(require("../../fs/fsPromise")); +const LineBasedCompareContext_1 = require("./LineBasedCompareContext"); +const BufferPool_1 = require("../../fs/BufferPool"); +const compareLineBatches_1 = require("./compare/compareLineBatches"); +const readBufferedLines_1 = require("./lineReader/readBufferedLines"); +const BUF_SIZE = 100000; +const MAX_CONCURRENT_FILE_COMPARE = 8; +const fdQueue = new FileDescriptorQueue_1.FileDescriptorQueue(MAX_CONCURRENT_FILE_COMPARE * 2); +const bufferPool = new BufferPool_1.BufferPool(BUF_SIZE, MAX_CONCURRENT_FILE_COMPARE); // fdQueue guarantees there will be no more than MAX_CONCURRENT_FILE_COMPARE async processes accessing the buffers concurrently +const lineBasedCompareAsync = (path1, stat1, path2, stat2, options) => __awaiter(void 0, void 0, void 0, function* () { + var _a; + const bufferSize = Math.min(BUF_SIZE, (_a = options.lineBasedHandlerBufferSize) !== null && _a !== void 0 ? _a : Number.MAX_VALUE); + let context; + try { + const fileDescriptors = yield Promise.all([fdQueue.openPromise(path1, 'r'), fdQueue.openPromise(path2, 'r')]); + context = new LineBasedCompareContext_1.LineBasedCompareContext(fileDescriptors[0], fileDescriptors[1], bufferPool.allocateBuffers()); + for (;;) { + const lineBatch1 = yield readLineBatchAsync(context.fd1, context.buffer.buf1, bufferSize, context.rest.rest1, context.restLines.restLines1); + const lineBatch2 = yield readLineBatchAsync(context.fd2, context.buffer.buf2, bufferSize, context.rest.rest2, context.restLines.restLines2); + context.rest.rest1 = lineBatch1.rest; + context.rest.rest2 = lineBatch2.rest; + const compareResult = compareLineBatches_1.compareLineBatches(lineBatch1, lineBatch2, options); + if (!compareResult.batchIsEqual) { + return false; + } + if (compareResult.reachedEof) { + return compareResult.batchIsEqual; + } + context.restLines.restLines1 = compareResult.restLines.restLines1; + context.restLines.restLines2 = compareResult.restLines.restLines2; + } + } + finally { + if (context) { + bufferPool.freeBuffers(context.buffer); + yield closeFile_1.default.closeFilesAsync(context.fd1, context.fd2, fdQueue); + } + } +}); +exports.lineBasedCompareAsync = lineBasedCompareAsync; +/** + * Reads a batch of lines from file starting with current position. + * + * @param fd File to read lines from. + * @param buf Buffer used as temporary line storage. + * @param bufferSize Allocated buffer size. The number of lines in the batch is limited by this size. + * @param rest Part of a line that was split at buffer boundary in a previous read. + * Will be added to result. + * @param restLines Lines that remain unprocessed from a previous read. + * Will be added to result. + */ +function readLineBatchAsync(fd, buf, bufferSize, rest, restLines) { + return __awaiter(this, void 0, void 0, function* () { + const size = yield fsPromise_1.default.read(fd, buf, 0, bufferSize, null); + return readBufferedLines_1.readBufferedLines(buf, size, bufferSize, rest, restLines); + }); +} +//# sourceMappingURL=compareAsync.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.js.map new file mode 100644 index 0000000..7d3ff45 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareAsync.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compareAsync.js","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/compareAsync.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,sEAAkE;AAClE,mEAA2C;AAC3C,mEAA0C;AAI1C,uEAAmE;AACnE,oDAAgD;AAChD,qEAAiE;AACjE,sEAAkE;AAGlE,MAAM,QAAQ,GAAG,MAAM,CAAA;AACvB,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAErC,MAAM,OAAO,GAAG,IAAI,yCAAmB,CAAC,2BAA2B,GAAG,CAAC,CAAC,CAAA;AACxE,MAAM,UAAU,GAAG,IAAI,uBAAU,CAAC,QAAQ,EAAE,2BAA2B,CAAC,CAAA,CAAE,+HAA+H;AAElM,MAAM,qBAAqB,GAAqB,CAAO,KAAa,EAAE,KAAe,EAAE,KAAa,EAAE,KAAe,EAAE,OAAgB,EAAoB,EAAE;;IAChK,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAA,OAAO,CAAC,0BAA0B,mCAAI,MAAM,CAAC,SAAS,CAAC,CAAA;IAC7F,IAAI,OAA4C,CAAA;IAChD,IAAI;QACA,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAA;QAC7G,OAAO,GAAG,IAAI,iDAAuB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,eAAe,EAAE,CAAC,CAAA;QAE3G,SAAU;YACN,MAAM,UAAU,GAAG,MAAM,k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AAE,IAAY,EAAE,SAAmB;;QAC5G,MAAM,IAAI,GAAG,MAAM,mBAAS,CAAC,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;QAC/D,OAAO,qCAAiB,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;IACpE,CAAC;CAAA"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.d.ts new file mode 100644 index 0000000..7f3a482 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.d.ts @@ -0,0 +1,3 @@ +import { CompareFileSync } from '../../types'; +export declare const lineBasedCompareSync: CompareFileSync; +//# sourceMappingURL=compareSync.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.d.ts.map new file mode 100644 index 0000000..fcb2c9e --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"compareSync.d.ts","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/compareSync.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAU7C,eAAO,MAAM,oBAAoB,EAAE,eA8BlC,CAAA"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.js new file mode 100644 index 0000000..816583d --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.js @@ -0,0 +1,60 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lineBasedCompareSync = void 0; +const fs_1 = __importDefault(require("fs")); +const closeFile_1 = __importDefault(require("../../fs/closeFile")); +const LineBasedCompareContext_1 = require("./LineBasedCompareContext"); +const compareLineBatches_1 = require("./compare/compareLineBatches"); +const readBufferedLines_1 = require("./lineReader/readBufferedLines"); +const BUF_SIZE = 100000; +const bufferPair = { + buf1: Buffer.alloc(BUF_SIZE), + buf2: Buffer.alloc(BUF_SIZE), + busy: true +}; +const lineBasedCompareSync = (path1, stat1, path2, stat2, options) => { + var _a; + const bufferSize = Math.min(BUF_SIZE, (_a = options.lineBasedHandlerBufferSize) !== null && _a !== void 0 ? _a : Number.MAX_VALUE); + let context; + try { + context = new LineBasedCompareContext_1.LineBasedCompareContext(fs_1.default.openSync(path1, 'r'), fs_1.default.openSync(path2, 'r'), bufferPair); + for (;;) { + const lineBatch1 = readLineBatchSync(context.fd1, context.buffer.buf1, bufferSize, context.rest.rest1, context.restLines.restLines1); + const lineBatch2 = readLineBatchSync(context.fd2, context.buffer.buf2, bufferSize, context.rest.rest2, context.restLines.restLines2); + context.rest.rest1 = lineBatch1.rest; + context.rest.rest2 = lineBatch2.rest; + const compareResult = compareLineBatches_1.compareLineBatches(lineBatch1, lineBatch2, options); + if (!compareResult.batchIsEqual) { + return false; + } + if (compareResult.reachedEof) { + return compareResult.batchIsEqual; + } + context.restLines.restLines1 = compareResult.restLines.restLines1; + context.restLines.restLines2 = compareResult.restLines.restLines2; + } + } + finally { + closeFile_1.default.closeFilesSync(context === null || context === void 0 ? void 0 : context.fd1, context === null || context === void 0 ? void 0 : context.fd2); + } +}; +exports.lineBasedCompareSync = lineBasedCompareSync; +/** + * Reads a batch of lines from file starting with current position. + * + * @param fd File to read lines from. + * @param buf Buffer used as temporary line storage. + * @param bufferSize Allocated buffer size. The number of lines in the batch is limited by this size. + * @param rest Part of a line that was split at buffer boundary in a previous read. + * Will be added to result. + * @param restLines Lines that remain unprocessed from a previous read. + * Will be added to result. + */ +function readLineBatchSync(fd, buf, bufferSize, rest, restLines) { + const size = fs_1.default.readSync(fd, buf, 0, bufferSize, null); + return readBufferedLines_1.readBufferedLines(buf, size, bufferSize, rest, restLines); +} +//# sourceMappingURL=compareSync.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.js.map new file mode 100644 index 0000000..cc0f38e --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/compareSync.js.map @@ -0,0 +1 @@ +{"version":3,"file":"compareSync.js","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/compareSync.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAmB;AAEnB,mEAA2C;AAC3C,uEAAmE;AACnE,qEAAiE;AACjE,sEAAkE;AAKlE,MAAM,QAAQ,GAAG,MAAM,CAAA;AAEvB,MAAM,UAAU,GAAe;IAC3B,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5B,IAAI,EAAE,IAAI;CACb,CAAA;AAEM,MAAM,oBAAoB,GAAoB,CAAC,KAAa,EAAE,KAAe,EAAE,KAAa,EAAE,KAAe,EAAE,OAAgB,EAAW,EAAE;;IAC/I,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,MAAA,OAAO,CAAC,0BAA0B,mCAAI,MAAM,CAAC,SAAS,CAAC,CAAA;IAC7F,IAAI,OAA4C,CAAA;IAChD,IAAI;QACA,OAAO,GAAG,IAAI,iDAAuB,CACjC,YAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,EACvB,YAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC,EACvB,UAAU,CACb,CAAA;QACD,SAAU;YACN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AAE,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,CAAA;IACtD,OAAO,qCAAiB,CAAC,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAAA;AACpE,CAAC"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.d.ts new file mode 100644 index 0000000..a9bc4b1 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.d.ts @@ -0,0 +1,7 @@ +import { CompareFileHandler } from '../../types'; +/** + * Compare files line by line with options to ignore + * line endings and white space differences. + */ +export declare const lineBasedFileCompare: CompareFileHandler; +//# sourceMappingURL=lineBasedFileCompare.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.d.ts.map new file mode 100644 index 0000000..8c7168d --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"lineBasedFileCompare.d.ts","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/lineBasedFileCompare.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,EAAE,kBAGlC,CAAA"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.js new file mode 100644 index 0000000..a88f613 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.lineBasedFileCompare = void 0; +const compareSync_1 = require("./compareSync"); +const compareAsync_1 = require("./compareAsync"); +/** + * Compare files line by line with options to ignore + * line endings and white space differences. + */ +exports.lineBasedFileCompare = { + compareSync: compareSync_1.lineBasedCompareSync, + compareAsync: compareAsync_1.lineBasedCompareAsync +}; +//# sourceMappingURL=lineBasedFileCompare.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.js.map new file mode 100644 index 0000000..36876d0 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineBasedFileCompare.js.map @@ -0,0 +1 @@ +{"version":3,"file":"lineBasedFileCompare.js","sourceRoot":"","sources":["../../../../src/fileCompareHandler/lines/lineBasedFileCompare.ts"],"names":[],"mappings":";;;AAAA,+CAAkD;AAClD,iDAAoD;AAGpD;;;GAGG;AACU,QAAA,oBAAoB,GAAuB;IACpD,WAAW,EAAE,kCAAoB;IACjC,YAAY,EAAE,oCAAqB;CACtC,CAAA"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.d.ts new file mode 100644 index 0000000..74a0470 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.d.ts @@ -0,0 +1,16 @@ +export interface LineBatch { + /** + * Batch of lines available after this read operation. + */ + lines: string[]; + /** + * First part of a line that was split due to buffer boundary. + * It will be used in a subsequent read to complete the next line. + */ + rest: string; + /** + * Whether we reached end of file. + */ + reachedEof: boolean; +} +//# sourceMappingURL=LineBatch.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.d.ts.map new file mode 100644 index 0000000..2b17f98 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"LineBatch.d.ts","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/lineReader/LineBatch.ts"],"names":[],"mappings":"AACA,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,EAAE,CAAA;IACf;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,UAAU,EAAE,OAAO,CAAA;CACtB"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.js new file mode 100644 index 0000000..a6f78b2 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=LineBatch.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.js.map new file mode 100644 index 0000000..6d42ea9 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/LineBatch.js.map @@ -0,0 +1 @@ +{"version":3,"file":"LineBatch.js","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/lineReader/LineBatch.ts"],"names":[],"mappings":""}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.d.ts b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.d.ts new file mode 100644 index 0000000..5e2c85e --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.d.ts @@ -0,0 +1,14 @@ +/// <reference types="node" /> +import { LineBatch } from './LineBatch'; +/** + * Reads lines from given buffer. + * @param buf Buffer to read lines from. + * @param size Size of data available in buffer. + * @param allocatedBufferSize Maximum buffer storage. + * @param rest Part of a line that was split at buffer boundary in a previous read. + * Will be added to result. + * @param restLines Lines that remain unprocessed from a previous read due to unbalanced buffers. + * Will be added to result. + */ +export declare function readBufferedLines(buf: Buffer, size: number, allocatedBufferSize: number, rest: string, restLines: string[]): LineBatch; +//# sourceMappingURL=readBufferedLines.d.ts.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.d.ts.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.d.ts.map new file mode 100644 index 0000000..cc2dcc0 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"readBufferedLines.d.ts","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/lineReader/readBufferedLines.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAKvC;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,SAAS,CAmBtI"}
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.js b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.js new file mode 100644 index 0000000..fe1f768 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.js @@ -0,0 +1,47 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.readBufferedLines = void 0; +const LINE_TOKENIZER_REGEXP = /[^\n]+\n?|\n/g; +/** + * Reads lines from given buffer. + * @param buf Buffer to read lines from. + * @param size Size of data available in buffer. + * @param allocatedBufferSize Maximum buffer storage. + * @param rest Part of a line that was split at buffer boundary in a previous read. + * Will be added to result. + * @param restLines Lines that remain unprocessed from a previous read due to unbalanced buffers. + * Will be added to result. + */ +function readBufferedLines(buf, size, allocatedBufferSize, rest, restLines) { + if (size === 0 && rest.length === 0) { + return { lines: [...restLines], rest: '', reachedEof: true }; + } + if (size === 0) { + return { lines: [...restLines, rest], rest: '', reachedEof: true }; + } + const fileContent = rest + buf.toString('utf8', 0, size); + const lines = [...restLines, ...fileContent.match(LINE_TOKENIZER_REGEXP)]; + const reachedEof = size < allocatedBufferSize; + if (reachedEof) { + return { + lines, rest: '', reachedEof: true + }; + } + return removeLastLine(lines); +} +exports.readBufferedLines = readBufferedLines; +/** + * Last line is usually incomplete because our buffer rarely matches exactly the end of a line. + * So we remove it from the line batch. + * The deleted line is returned as the 'rest' parameter and will be incorporate at the beginning + * of next read operation. + */ +function removeLastLine(lines) { + const lastLine = lines[lines.length - 1]; + return { + lines: lines.slice(0, lines.length - 1), + rest: lastLine, + reachedEof: false + }; +} +//# sourceMappingURL=readBufferedLines.js.map
\ No newline at end of file diff --git a/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.js.map b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.js.map new file mode 100644 index 0000000..6b2f7e1 --- /dev/null +++ b/desktop/node_modules/dir-compare/build/src/fileCompareHandler/lines/lineReader/readBufferedLines.js.map @@ -0,0 +1 @@ +{"version":3,"file":"readBufferedLines.js","sourceRoot":"","sources":["../../../../../src/fileCompareHandler/lines/lineReader/readBufferedLines.ts"],"names":[],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