1338 lines
No EOL
116 KiB
JavaScript
1338 lines
No EOL
116 KiB
JavaScript
/*!
|
||
|
||
diff v2.2.2
|
||
|
||
Software License Agreement (BSD License)
|
||
|
||
Copyright (c) 2009-2015, Kevin Decker <kpdecker@gmail.com>
|
||
|
||
All rights reserved.
|
||
|
||
Redistribution and use of this software in source and binary forms, with or without modification,
|
||
are permitted provided that the following conditions are met:
|
||
|
||
* Redistributions of source code must retain the above
|
||
copyright notice, this list of conditions and the
|
||
following disclaimer.
|
||
|
||
* Redistributions in binary form must reproduce the above
|
||
copyright notice, this list of conditions and the
|
||
following disclaimer in the documentation and/or other
|
||
materials provided with the distribution.
|
||
|
||
* Neither the name of Kevin Decker nor the names of its
|
||
contributors may be used to endorse or promote products
|
||
derived from this software without specific prior
|
||
written permission.
|
||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
||
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
|
||
IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||
@license
|
||
*/
|
||
(function webpackUniversalModuleDefinition(root, factory) {
|
||
if(typeof exports === 'object' && typeof module === 'object')
|
||
module.exports = factory();
|
||
else if(typeof define === 'function' && define.amd)
|
||
define([], factory);
|
||
else if(typeof exports === 'object')
|
||
exports["JsDiff"] = factory();
|
||
else
|
||
root["JsDiff"] = factory();
|
||
})(this, function() {
|
||
return /******/ (function(modules) { // webpackBootstrap
|
||
/******/ // The module cache
|
||
/******/ var installedModules = {};
|
||
|
||
/******/ // The require function
|
||
/******/ function __webpack_require__(moduleId) {
|
||
|
||
/******/ // Check if module is in cache
|
||
/******/ if(installedModules[moduleId])
|
||
/******/ return installedModules[moduleId].exports;
|
||
|
||
/******/ // Create a new module (and put it into the cache)
|
||
/******/ var module = installedModules[moduleId] = {
|
||
/******/ exports: {},
|
||
/******/ id: moduleId,
|
||
/******/ loaded: false
|
||
/******/ };
|
||
|
||
/******/ // Execute the module function
|
||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||
|
||
/******/ // Flag the module as loaded
|
||
/******/ module.loaded = true;
|
||
|
||
/******/ // Return the exports of the module
|
||
/******/ return module.exports;
|
||
/******/ }
|
||
|
||
|
||
/******/ // expose the modules object (__webpack_modules__)
|
||
/******/ __webpack_require__.m = modules;
|
||
|
||
/******/ // expose the module cache
|
||
/******/ __webpack_require__.c = installedModules;
|
||
|
||
/******/ // __webpack_public_path__
|
||
/******/ __webpack_require__.p = "";
|
||
|
||
/******/ // Load entry module and return exports
|
||
/******/ return __webpack_require__(0);
|
||
/******/ })
|
||
/************************************************************************/
|
||
/******/ ([
|
||
/* 0 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.canonicalize = exports.convertChangesToXML = exports.convertChangesToDMP = exports.parsePatch = exports.applyPatches = exports.applyPatch = exports.createPatch = exports.createTwoFilesPatch = exports.structuredPatch = exports.diffJson = exports.diffCss = exports.diffSentences = exports.diffTrimmedLines = exports.diffLines = exports.diffWordsWithSpace = exports.diffWords = exports.diffChars = exports.Diff = undefined;
|
||
/*istanbul ignore end*/
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
/*istanbul ignore end*/
|
||
var /*istanbul ignore start*/_character = __webpack_require__(2) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_word = __webpack_require__(3) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_sentence = __webpack_require__(6) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_css = __webpack_require__(7) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_json = __webpack_require__(8) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_apply = __webpack_require__(9) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_parse = __webpack_require__(10) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_create = __webpack_require__(12) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_dmp = __webpack_require__(13) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_xml = __webpack_require__(14) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/* See LICENSE file for terms of use */
|
||
|
||
/*
|
||
* Text diff implementation.
|
||
*
|
||
* This library supports the following APIS:
|
||
* JsDiff.diffChars: Character by character diff
|
||
* JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
|
||
* JsDiff.diffLines: Line based diff
|
||
*
|
||
* JsDiff.diffCss: Diff targeted at CSS content
|
||
*
|
||
* These methods are based on the implementation proposed in
|
||
* "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
|
||
* http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
|
||
*/
|
||
exports. /*istanbul ignore end*/Diff = _base2.default;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffChars = _character.diffChars;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffWords = _word.diffWords;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = _word.diffWordsWithSpace;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffLines = _line.diffLines;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = _line.diffTrimmedLines;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffSentences = _sentence.diffSentences;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffCss = _css.diffCss;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffJson = _json.diffJson;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/structuredPatch = _create.structuredPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = _create.createTwoFilesPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = _create.createPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatch = _apply.applyPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = _apply.applyPatches;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/parsePatch = _parse.parsePatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToDMP = _dmp.convertChangesToDMP;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/convertChangesToXML = _xml.convertChangesToXML;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = _json.canonicalize;
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQWdCQTs7Ozs7O0FBQ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jcmVhdGVUd29GaWxlc1BhdGNoLFxuICBjcmVhdGVQYXRjaCxcbiAgYXBwbHlQYXRjaCxcbiAgYXBwbHlQYXRjaGVzLFxuICBwYXJzZVBhdGNoLFxuICBjb252ZXJ0Q2hhbmdlc1RvRE1QLFxuICBjb252ZXJ0Q2hhbmdlc1RvWE1MLFxuICBjYW5vbmljYWxpemVcbn07XG4iXX0=
|
||
|
||
|
||
/***/ },
|
||
/* 1 */
|
||
/***/ function(module, exports) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.default = /*istanbul ignore end*/Diff;
|
||
function Diff() {}
|
||
|
||
Diff.prototype = { /*istanbul ignore start*/
|
||
/*istanbul ignore end*/diff: function diff(oldString, newString) {
|
||
/*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
|
||
|
||
var callback = options.callback;
|
||
if (typeof options === 'function') {
|
||
callback = options;
|
||
options = {};
|
||
}
|
||
this.options = options;
|
||
|
||
var self = this;
|
||
|
||
function done(value) {
|
||
if (callback) {
|
||
setTimeout(function () {
|
||
callback(undefined, value);
|
||
}, 0);
|
||
return true;
|
||
} else {
|
||
return value;
|
||
}
|
||
}
|
||
|
||
// Allow subclasses to massage the input prior to running
|
||
oldString = this.castInput(oldString);
|
||
newString = this.castInput(newString);
|
||
|
||
oldString = this.removeEmpty(this.tokenize(oldString));
|
||
newString = this.removeEmpty(this.tokenize(newString));
|
||
|
||
var newLen = newString.length,
|
||
oldLen = oldString.length;
|
||
var editLength = 1;
|
||
var maxEditLength = newLen + oldLen;
|
||
var bestPath = [{ newPos: -1, components: [] }];
|
||
|
||
// Seed editLength = 0, i.e. the content starts with the same values
|
||
var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
|
||
if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {
|
||
// Identity per the equality and tokenizer
|
||
return done([{ value: newString.join(''), count: newString.length }]);
|
||
}
|
||
|
||
// Main worker method. checks all permutations of a given edit length for acceptance.
|
||
function execEditLength() {
|
||
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
|
||
var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
|
||
var addPath = bestPath[diagonalPath - 1],
|
||
removePath = bestPath[diagonalPath + 1],
|
||
_oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
|
||
if (addPath) {
|
||
// No one else is going to attempt to use this value, clear it
|
||
bestPath[diagonalPath - 1] = undefined;
|
||
}
|
||
|
||
var canAdd = addPath && addPath.newPos + 1 < newLen,
|
||
canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;
|
||
if (!canAdd && !canRemove) {
|
||
// If this path is a terminal then prune
|
||
bestPath[diagonalPath] = undefined;
|
||
continue;
|
||
}
|
||
|
||
// Select the diagonal that we want to branch from. We select the prior
|
||
// path whose position in the new string is the farthest from the origin
|
||
// and does not pass the bounds of the diff graph
|
||
if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {
|
||
basePath = clonePath(removePath);
|
||
self.pushComponent(basePath.components, undefined, true);
|
||
} else {
|
||
basePath = addPath; // No need to clone, we've pulled it from the list
|
||
basePath.newPos++;
|
||
self.pushComponent(basePath.components, true, undefined);
|
||
}
|
||
|
||
_oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);
|
||
|
||
// If we have hit the end of both strings, then we are done
|
||
if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {
|
||
return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));
|
||
} else {
|
||
// Otherwise track this path as a potential candidate and continue.
|
||
bestPath[diagonalPath] = basePath;
|
||
}
|
||
}
|
||
|
||
editLength++;
|
||
}
|
||
|
||
// Performs the length of edit iteration. Is a bit fugly as this has to support the
|
||
// sync and async mode which is never fun. Loops over execEditLength until a value
|
||
// is produced.
|
||
if (callback) {
|
||
(function exec() {
|
||
setTimeout(function () {
|
||
// This should not happen, but we want to be safe.
|
||
/* istanbul ignore next */
|
||
if (editLength > maxEditLength) {
|
||
return callback();
|
||
}
|
||
|
||
if (!execEditLength()) {
|
||
exec();
|
||
}
|
||
}, 0);
|
||
})();
|
||
} else {
|
||
while (editLength <= maxEditLength) {
|
||
var ret = execEditLength();
|
||
if (ret) {
|
||
return ret;
|
||
}
|
||
}
|
||
}
|
||
},
|
||
/*istanbul ignore start*/ /*istanbul ignore end*/pushComponent: function pushComponent(components, added, removed) {
|
||
var last = components[components.length - 1];
|
||
if (last && last.added === added && last.removed === removed) {
|
||
// We need to clone here as the component clone operation is just
|
||
// as shallow array clone
|
||
components[components.length - 1] = { count: last.count + 1, added: added, removed: removed };
|
||
} else {
|
||
components.push({ count: 1, added: added, removed: removed });
|
||
}
|
||
},
|
||
/*istanbul ignore start*/ /*istanbul ignore end*/extractCommon: function extractCommon(basePath, newString, oldString, diagonalPath) {
|
||
var newLen = newString.length,
|
||
oldLen = oldString.length,
|
||
newPos = basePath.newPos,
|
||
oldPos = newPos - diagonalPath,
|
||
commonCount = 0;
|
||
while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {
|
||
newPos++;
|
||
oldPos++;
|
||
commonCount++;
|
||
}
|
||
|
||
if (commonCount) {
|
||
basePath.components.push({ count: commonCount });
|
||
}
|
||
|
||
basePath.newPos = newPos;
|
||
return oldPos;
|
||
},
|
||
/*istanbul ignore start*/ /*istanbul ignore end*/equals: function equals(left, right) {
|
||
return left === right;
|
||
},
|
||
/*istanbul ignore start*/ /*istanbul ignore end*/removeEmpty: function removeEmpty(array) {
|
||
var ret = [];
|
||
for (var i = 0; i < array.length; i++) {
|
||
if (array[i]) {
|
||
ret.push(array[i]);
|
||
}
|
||
}
|
||
return ret;
|
||
},
|
||
/*istanbul ignore start*/ /*istanbul ignore end*/castInput: function castInput(value) {
|
||
return value;
|
||
},
|
||
/*istanbul ignore start*/ /*istanbul ignore end*/tokenize: function tokenize(value) {
|
||
return value.split('');
|
||
}
|
||
};
|
||
|
||
function buildValues(diff, components, newString, oldString, useLongestToken) {
|
||
var componentPos = 0,
|
||
componentLen = components.length,
|
||
newPos = 0,
|
||
oldPos = 0;
|
||
|
||
for (; componentPos < componentLen; componentPos++) {
|
||
var component = components[componentPos];
|
||
if (!component.removed) {
|
||
if (!component.added && useLongestToken) {
|
||
var value = newString.slice(newPos, newPos + component.count);
|
||
value = value.map(function (value, i) {
|
||
var oldValue = oldString[oldPos + i];
|
||
return oldValue.length > value.length ? oldValue : value;
|
||
});
|
||
|
||
component.value = value.join('');
|
||
} else {
|
||
component.value = newString.slice(newPos, newPos + component.count).join('');
|
||
}
|
||
newPos += component.count;
|
||
|
||
// Common case
|
||
if (!component.added) {
|
||
oldPos += component.count;
|
||
}
|
||
} else {
|
||
component.value = oldString.slice(oldPos, oldPos + component.count).join('');
|
||
oldPos += component.count;
|
||
|
||
// Reverse add and remove so removes are output first to match common convention
|
||
// The diffing algorithm is tied to add then remove output and this is the simplest
|
||
// route to get the desired output with minimal overhead.
|
||
if (componentPos && components[componentPos - 1].added) {
|
||
var tmp = components[componentPos - 1];
|
||
components[componentPos - 1] = components[componentPos];
|
||
components[componentPos] = tmp;
|
||
}
|
||
}
|
||
}
|
||
|
||
// Special case handle for when one terminal is ignored. For this case we merge the
|
||
// terminal into the prior string and drop the change.
|
||
var lastComponent = components[componentLen - 1];
|
||
if (componentLen > 1 && (lastComponent.added || lastComponent.removed) && diff.equals('', lastComponent.value)) {
|
||
components[componentLen - 2].value += lastComponent.value;
|
||
components.pop();
|
||
}
|
||
|
||
return components;
|
||
}
|
||
|
||
function clonePath(path) {
|
||
return { newPos: path.newPos, components: path.components.slice(0) };
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Jhc2UuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O3lDQUF3QjtBQUFULFNBQVM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b2xkUG9zKys7XG4gICAgICBjb21tb25Db3VudCsrO1xuICAgIH1cblxuICAgIGlmIChjb21tb25Db3VudCkge1xuICAgICAgYmFzZVBhdGguY29tcG9uZW50cy5wdXNoKHtjb3VudDogY29tbW9uQ291bnR9KTtcbiAgICB9XG5cbiAgICBiYXNlUGF0aC5uZXdQb3MgPSBuZXdQb3M7XG4gICAgcmV0dXJuIG9sZFBvcztcbiAgfSxcblxuICBlcXVhbHMobGVmdCwgcmlnaHQpIHtcbiAgICByZXR1cm4gbGVmdCA9PT0gcmlnaHQ7XG4gIH0sXG4gIHJlbW92ZUVtcHR5KGFycmF5KSB7XG4gICAgbGV0IHJldCA9IFtdO1xuICAgIGZvciAobGV0IGkgPSAwOyBpIDwgYXJyYXkubGVuZ3RoOyBpKyspIHtcbiAgICAgIGlmIChhcnJheVtpXSkge1xuICAgICAgICByZXQucHVzaChhcnJheVtpXSk7XG4gICAgICB9XG4gICAgfVxuICAgIHJldHVybiByZXQ7XG4gIH0sXG4gIGNhc3RJbnB1dCh2YWx1ZSkge1xuICAgIHJldHVybiB2YWx1ZTtcbiAgfSxcbiAgdG9rZW5pemUodmFsdWUpIHtcbiAgICByZXR1cm4gdmFsdWUuc3BsaXQoJycpO1xuICB9XG59O1xuXG5mdW5jdGlvbiBidWlsZFZhbHVlcyhkaWZmLCBjb21wb25lbnRzLCBuZXdTdHJpbmcsIG9sZFN0cmluZywgdXNlTG9uZ2VzdFRva2VuKSB7XG4gIGxldCBjb21wb25lbnRQb3MgPSAwLFxuICAgICAgY29tcG9uZW50TGVuID0gY29tcG9uZW50cy5sZW5ndGgsXG4gICAgICBuZXdQb3MgPSAwLFxuICAgICAgb2xkUG9zID0gMDtcblxuICBmb3IgKDsgY29tcG9uZW50UG9zIDwgY29tcG9uZW50TGVuOyBjb21wb25lbnRQb3MrKykge1xuICAgIGxldCBjb21wb25lbnQgPSBjb21wb25lbnRzW2NvbXBvbmVudFBvc107XG4gICAgaWYgKCFjb21wb25lbnQucmV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cztcbn1cblxuZnVuY3Rpb24gY2xvbmVQYXRoKHBhdGgpIHtcbiAgcmV0dXJuIHsgbmV3UG9zOiBwYXRoLm5ld1BvcywgY29tcG9uZW50czogcGF0aC5jb21wb25lbnRzLnNsaWNlKDApIH07XG59XG4iXX0=
|
||
|
||
|
||
/***/ },
|
||
/* 2 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.characterDiff = undefined;
|
||
exports. /*istanbul ignore end*/diffChars = diffChars;
|
||
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/var characterDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/characterDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
|
||
function diffChars(oldStr, newStr, callback) {
|
||
return characterDiff.diff(oldStr, newStr, callback);
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2NoYXJhY3Rlci5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQUdnQjs7QUFIaEI7Ozs7Ozs7dUJBRU8sSUFBTSx5RkFBZ0IscUVBQWhCO0FBQ04sU0FBUyxTQUFULENBQW1CLE1BQW5CLEVBQTJCLE1BQTNCLEVBQW1DLFFBQW5DLEVBQTZDO0FBQUUsU0FBTyxjQUFjLElBQWQsQ0FBbUIsTUFBbkIsRUFBMkIsTUFBM0IsRUFBbUMsUUFBbkMsQ0FBUCxDQUFGO0NBQTdDIiwiZmlsZSI6ImNoYXJhY3Rlci5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cbmV4cG9ydCBjb25zdCBjaGFyYWN0ZXJEaWZmID0gbmV3IERpZmYoKTtcbmV4cG9ydCBmdW5jdGlvbiBkaWZmQ2hhcnMob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBjaGFyYWN0ZXJEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuIl19
|
||
|
||
|
||
/***/ },
|
||
/* 3 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.wordDiff = undefined;
|
||
exports. /*istanbul ignore end*/diffWords = diffWords;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffWordsWithSpace = diffWordsWithSpace;
|
||
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
/*istanbul ignore end*/
|
||
var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/
|
||
|
||
// Based on https://en.wikipedia.org/wiki/Latin_script_in_Unicode
|
||
//
|
||
// Ranges and exceptions:
|
||
// Latin-1 Supplement, 0080–00FF
|
||
// - U+00D7 × Multiplication sign
|
||
// - U+00F7 ÷ Division sign
|
||
// Latin Extended-A, 0100–017F
|
||
// Latin Extended-B, 0180–024F
|
||
// IPA Extensions, 0250–02AF
|
||
// Spacing Modifier Letters, 02B0–02FF
|
||
// - U+02C7 ˇ ˇ Caron
|
||
// - U+02D8 ˘ ˘ Breve
|
||
// - U+02D9 ˙ ˙ Dot Above
|
||
// - U+02DA ˚ ˚ Ring Above
|
||
// - U+02DB ˛ ˛ Ogonek
|
||
// - U+02DC ˜ ˜ Small Tilde
|
||
// - U+02DD ˝ ˝ Double Acute Accent
|
||
// Latin Extended Additional, 1E00–1EFF
|
||
var extendedWordChars = /^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/;
|
||
|
||
var reWhitespace = /\S/;
|
||
|
||
var wordDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/wordDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
|
||
wordDiff.equals = function (left, right) {
|
||
return left === right || this.options.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right);
|
||
};
|
||
wordDiff.tokenize = function (value) {
|
||
var tokens = value.split(/(\s+|\b)/);
|
||
|
||
// Join the boundary splits that we do not consider to be boundaries. This is primarily the extended Latin character set.
|
||
for (var i = 0; i < tokens.length - 1; i++) {
|
||
// If we have an empty string in the next field and we have only word chars before and after, merge
|
||
if (!tokens[i + 1] && tokens[i + 2] && extendedWordChars.test(tokens[i]) && extendedWordChars.test(tokens[i + 2])) {
|
||
tokens[i] += tokens[i + 2];
|
||
tokens.splice(i + 1, 2);
|
||
i--;
|
||
}
|
||
}
|
||
|
||
return tokens;
|
||
};
|
||
|
||
function diffWords(oldStr, newStr, callback) {
|
||
var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
|
||
return wordDiff.diff(oldStr, newStr, options);
|
||
}
|
||
function diffWordsWithSpace(oldStr, newStr, callback) {
|
||
return wordDiff.diff(oldStr, newStr, callback);
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3dvcmQuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0ErQ2dCO3lEQUlBOztBQW5EaEI7Ozs7OztBQUNBOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0JBLElBQU0sb0JBQW9CLCt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vciAobGV0IGkgPSAwOyBpIDwgdG9rZW5zLmxlbmd0aCAtIDE7IGkrKykge1xuICAgIC8vIElmIHdlIGhhdmUgYW4gZW1wdHkgc3RyaW5nIGluIHRoZSBuZXh0IGZpZWxkIGFuZCB3ZSBoYXZlIG9ubHkgd29yZCBjaGFycyBiZWZvcmUgYW5kIGFmdGVyLCBtZXJnZVxuICAgIGlmICghdG9rZW5zW2kgKyAxXSAmJiB0b2tlbnNbaSArIDJdXG4gICAgICAgICAgJiYgZXh0ZW5kZWRXb3JkQ2hhcnMudGVzdCh0b2tlbnNbaV0pXG4gICAgICAgICAgJiYgZXh0ZW5kZWRXb3JkQ2hhcnMudGVzdCh0b2tlbnNbaSArIDJdKSkge1xuICAgICAgdG9rZW5zW2ldICs9IHRva2Vuc1tpICsgMl07XG4gICAgICB0b2tlbnMuc3BsaWNlKGkgKyAxLCAyKTtcbiAgICAgIGktLTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4gdG9rZW5zO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZXb3JkcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHtcbiAgbGV0IG9wdGlvbnMgPSBnZW5lcmF0ZU9wdGlvbnMoY2FsbGJhY2ssIHtpZ25vcmVXaGl0ZXNwYWNlOiB0cnVlfSk7XG4gIHJldHVybiB3b3JkRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBvcHRpb25zKTtcbn1cbmV4cG9ydCBmdW5jdGlvbiBkaWZmV29yZHNXaXRoU3BhY2Uob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7XG4gIHJldHVybiB3b3JkRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7XG59XG4iXX0=
|
||
|
||
|
||
/***/ },
|
||
/* 4 */
|
||
/***/ function(module, exports) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports. /*istanbul ignore end*/generateOptions = generateOptions;
|
||
function generateOptions(options, defaults) {
|
||
if (typeof options === 'function') {
|
||
defaults.callback = options;
|
||
} else if (options) {
|
||
for (var name in options) {
|
||
/* istanbul ignore else */
|
||
if (options.hasOwnProperty(name)) {
|
||
defaults[name] = options[name];
|
||
}
|
||
}
|
||
}
|
||
return defaults;
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL3BhcmFtcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCO0FBQVQsU0FBUyxlQUFULENBQXlCLE9BQXpCLEVBQWtDLFFBQWxDLEVBQTRDO0FBQ2pELE1BQUksT0FBTyxPQUFQLEtBQW1CLFVBQW5CLEVBQStCO0FBQ2pDLGFBQVMsUUFBVCxHQUFvQixPQUFwQixDQURpQztHQUFuQyxNQUVPLElBQUksT0FBSixFQUFhO0FBQ2xCLFNBQUssSUFBSSxJQUFKLElBQVksT0FBakIsRUFBMEI7O0FBRXhCLFVBQUksUUFBUSxjQUFSLENBQXVCLElBQXZCLENBQUosRUFBa0M7QUFDaEMsaUJBQVMsSUFBVCxJQUFpQixRQUFRLElBQVIsQ0FBakIsQ0FEZ0M7T0FBbEM7S0FGRjtHQURLO0FBUVAsU0FBTyxRQUFQLENBWGlEO0NBQTVDIiwiZmlsZSI6InBhcmFtcy5qcyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiBnZW5lcmF0ZU9wdGlvbnMob3B0aW9ucywgZGVmYXVsdHMpIHtcbiAgaWYgKHR5cGVvZiBvcHRpb25zID09PSAnZnVuY3Rpb24nKSB7XG4gICAgZGVmYXVsdHMuY2FsbGJhY2sgPSBvcHRpb25zO1xuICB9IGVsc2UgaWYgKG9wdGlvbnMpIHtcbiAgICBmb3IgKGxldCBuYW1lIGluIG9wdGlvbnMpIHtcbiAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICBpZiAob3B0aW9ucy5oYXNPd25Qcm9wZXJ0eShuYW1lKSkge1xuICAgICAgICBkZWZhdWx0c1tuYW1lXSA9IG9wdGlvbnNbbmFtZV07XG4gICAgICB9XG4gICAgfVxuICB9XG4gIHJldHVybiBkZWZhdWx0cztcbn1cbiJdfQ==
|
||
|
||
|
||
/***/ },
|
||
/* 5 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.lineDiff = undefined;
|
||
exports. /*istanbul ignore end*/diffLines = diffLines;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/diffTrimmedLines = diffTrimmedLines;
|
||
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
/*istanbul ignore end*/
|
||
var /*istanbul ignore start*/_params = __webpack_require__(4) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/var lineDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/lineDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
|
||
lineDiff.tokenize = function (value) {
|
||
var retLines = [],
|
||
linesAndNewlines = value.split(/(\n|\r\n)/);
|
||
|
||
// Ignore the final empty token that occurs if the string ends with a new line
|
||
if (!linesAndNewlines[linesAndNewlines.length - 1]) {
|
||
linesAndNewlines.pop();
|
||
}
|
||
|
||
// Merge the content and line separators into single tokens
|
||
for (var i = 0; i < linesAndNewlines.length; i++) {
|
||
var line = linesAndNewlines[i];
|
||
|
||
if (i % 2 && !this.options.newlineIsToken) {
|
||
retLines[retLines.length - 1] += line;
|
||
} else {
|
||
if (this.options.ignoreWhitespace) {
|
||
line = line.trim();
|
||
}
|
||
retLines.push(line);
|
||
}
|
||
}
|
||
|
||
return retLines;
|
||
};
|
||
|
||
function diffLines(oldStr, newStr, callback) {
|
||
return lineDiff.diff(oldStr, newStr, callback);
|
||
}
|
||
function diffTrimmedLines(oldStr, newStr, callback) {
|
||
var options = /*istanbul ignore start*/(0, _params.generateOptions) /*istanbul ignore end*/(callback, { ignoreWhitespace: true });
|
||
return lineDiff.diff(oldStr, newStr, options);
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2xpbmUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztnQ0E4QmdCO3lEQUNBOztBQS9CaEI7Ozs7OztBQUNBOzs7Ozt1QkFFTyxJQUFNLCtFQUFXLHFFQUFYO0FBQ2IsU0FBUyxRQUFULEdBQW9CLFVBQVMsS0FBVCxFQUFnQjtBQUNsQyxNQUFJLFdBQVcsRUFBWDtNQUNBLG1CQUFtQixNQUFNLEtBQU4sQ0FBWSxXQUFaLENBQW5COzs7QUFGOEIsTUFLOUIsQ0FBQyxpQkFBaUIsaUJBQWlCLE1BQWpCLEdBQTBCLENBQTFCLENBQWxCLEVBQWdEO0FBQ2xELHFCQUFpQixHQUFqQixHQURrRDtHQUFwRDs7O0FBTGtDLE9BVTdCLElBQUksSUFBSSxDQUFKLEVBQU8sSUFBSSxpQkFBaUIsTUFBakIsRUFBeUIsR0FBN0MsRUFBa0Q7QUFDaEQsUUFBSSxPQUFPLGlCQUFpQixDQUFqQixDQUFQLENBRDRDOztBQUdoRCxRQUFJLElBQUksQ0FBSixJQUFTLENBQUMsS0FBSyxPQUFMLENBQWEsY0FBYixFQUE2QjtBQUN6QyxlQUFTLFNBQVMsTUFBVCxHQUFrQixDQUFsQixDQUFULElBQWlDLElBQWpDLENBRHlDO0tBQTNDLE1BRU87QUFDTCxVQUFJLEtBQUssT0FBTCxDQUFhLGdCQUFiLEVBQStCO0FBQ2pDLG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
/* 6 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.sentenceDiff = undefined;
|
||
exports. /*istanbul ignore end*/diffSentences = diffSentences;
|
||
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/var sentenceDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/sentenceDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
|
||
sentenceDiff.tokenize = function (value) {
|
||
return value.split(/(\S.+?[.!?])(?=\s+|$)/);
|
||
};
|
||
|
||
function diffSentences(oldStr, newStr, callback) {
|
||
return sentenceDiff.diff(oldStr, newStr, callback);
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL3NlbnRlbmNlLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Z0NBUWdCOztBQVJoQjs7Ozs7Ozt1QkFHTyxJQUFNLHVGQUFlLHFFQUFmO0FBQ2IsYUFBYSxRQUFiLEdBQXdCLFVBQVMsS0FBVCxFQUFnQjtBQUN0QyxTQUFPLE1BQU0sS0FBTixDQUFZLHVCQUFaLENBQVAsQ0FEc0M7Q0FBaEI7O0FBSWpCLFNBQVMsYUFBVCxDQUF1QixNQUF2QixFQUErQixNQUEvQixFQUF1QyxRQUF2QyxFQUFpRDtBQUFFLFNBQU8sYUFBYSxJQUFiLENBQWtCLE1BQWxCLEVBQTBCLE1BQTFCLEVBQWtDLFFBQWxDLENBQVAsQ0FBRjtDQUFqRCIsImZpbGUiOiJzZW50ZW5jZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBEaWZmIGZyb20gJy4vYmFzZSc7XG5cblxuZXhwb3J0IGNvbnN0IHNlbnRlbmNlRGlmZiA9IG5ldyBEaWZmKCk7XG5zZW50ZW5jZURpZmYudG9rZW5pemUgPSBmdW5jdGlvbih2YWx1ZSkge1xuICByZXR1cm4gdmFsdWUuc3BsaXQoLyhcXFMuKz9bLiE/XSkoPz1cXHMrfCQpLyk7XG59O1xuXG5leHBvcnQgZnVuY3Rpb24gZGlmZlNlbnRlbmNlcyhvbGRTdHIsIG5ld1N0ciwgY2FsbGJhY2spIHsgcmV0dXJuIHNlbnRlbmNlRGlmZi5kaWZmKG9sZFN0ciwgbmV3U3RyLCBjYWxsYmFjayk7IH1cbiJdfQ==
|
||
|
||
|
||
/***/ },
|
||
/* 7 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.cssDiff = undefined;
|
||
exports. /*istanbul ignore end*/diffCss = diffCss;
|
||
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/var cssDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/cssDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
|
||
cssDiff.tokenize = function (value) {
|
||
return value.split(/([{}:;,]|\s+)/);
|
||
};
|
||
|
||
function diffCss(oldStr, newStr, callback) {
|
||
return cssDiff.diff(oldStr, newStr, callback);
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2Nzcy5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O2dDQU9nQjs7QUFQaEI7Ozs7Ozs7dUJBRU8sSUFBTSw2RUFBVSxxRUFBVjtBQUNiLFFBQVEsUUFBUixHQUFtQixVQUFTLEtBQVQsRUFBZ0I7QUFDakMsU0FBTyxNQUFNLEtBQU4sQ0FBWSxlQUFaLENBQVAsQ0FEaUM7Q0FBaEI7O0FBSVosU0FBUyxPQUFULENBQWlCLE1BQWpCLEVBQXlCLE1BQXpCLEVBQWlDLFFBQWpDLEVBQTJDO0FBQUUsU0FBTyxRQUFRLElBQVIsQ0FBYSxNQUFiLEVBQXFCLE1BQXJCLEVBQTZCLFFBQTdCLENBQVAsQ0FBRjtDQUEzQyIsImZpbGUiOiJjc3MuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgRGlmZiBmcm9tICcuL2Jhc2UnO1xuXG5leHBvcnQgY29uc3QgY3NzRGlmZiA9IG5ldyBEaWZmKCk7XG5jc3NEaWZmLnRva2VuaXplID0gZnVuY3Rpb24odmFsdWUpIHtcbiAgcmV0dXJuIHZhbHVlLnNwbGl0KC8oW3t9OjssXXxcXHMrKS8pO1xufTtcblxuZXhwb3J0IGZ1bmN0aW9uIGRpZmZDc3Mob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKSB7IHJldHVybiBjc3NEaWZmLmRpZmYob2xkU3RyLCBuZXdTdHIsIGNhbGxiYWNrKTsgfVxuIl19
|
||
|
||
|
||
/***/ },
|
||
/* 8 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports.jsonDiff = undefined;
|
||
|
||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; };
|
||
|
||
exports. /*istanbul ignore end*/diffJson = diffJson;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/canonicalize = canonicalize;
|
||
|
||
var /*istanbul ignore start*/_base = __webpack_require__(1) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _base2 = _interopRequireDefault(_base);
|
||
|
||
/*istanbul ignore end*/
|
||
var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/
|
||
|
||
var objectPrototypeToString = Object.prototype.toString;
|
||
|
||
var jsonDiff = /*istanbul ignore start*/exports. /*istanbul ignore end*/jsonDiff = new /*istanbul ignore start*/_base2.default() /*istanbul ignore end*/;
|
||
// Discriminate between two lines of pretty-printed, serialized JSON where one of them has a
|
||
// dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:
|
||
jsonDiff.useLongestToken = true;
|
||
|
||
jsonDiff.tokenize = /*istanbul ignore start*/_line.lineDiff. /*istanbul ignore end*/tokenize;
|
||
jsonDiff.castInput = function (value) {
|
||
return typeof value === 'string' ? value : JSON.stringify(canonicalize(value), undefined, ' ');
|
||
};
|
||
jsonDiff.equals = function (left, right) {
|
||
return (/*istanbul ignore start*/_base2.default. /*istanbul ignore end*/prototype.equals(left.replace(/,([\r\n])/g, '$1'), right.replace(/,([\r\n])/g, '$1'))
|
||
);
|
||
};
|
||
|
||
function diffJson(oldObj, newObj, callback) {
|
||
return jsonDiff.diff(oldObj, newObj, callback);
|
||
}
|
||
|
||
// This function handles the presence of circular references by bailing out when encountering an
|
||
// object that is already on the "stack" of items being processed.
|
||
function canonicalize(obj, stack, replacementStack) {
|
||
stack = stack || [];
|
||
replacementStack = replacementStack || [];
|
||
|
||
var i = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
|
||
|
||
for (i = 0; i < stack.length; i += 1) {
|
||
if (stack[i] === obj) {
|
||
return replacementStack[i];
|
||
}
|
||
}
|
||
|
||
var canonicalizedObj = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
|
||
|
||
if ('[object Array]' === objectPrototypeToString.call(obj)) {
|
||
stack.push(obj);
|
||
canonicalizedObj = new Array(obj.length);
|
||
replacementStack.push(canonicalizedObj);
|
||
for (i = 0; i < obj.length; i += 1) {
|
||
canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack);
|
||
}
|
||
stack.pop();
|
||
replacementStack.pop();
|
||
return canonicalizedObj;
|
||
}
|
||
|
||
if (obj && obj.toJSON) {
|
||
obj = obj.toJSON();
|
||
}
|
||
|
||
if ( /*istanbul ignore start*/(typeof /*istanbul ignore end*/obj === 'undefined' ? 'undefined' : _typeof(obj)) === 'object' && obj !== null) {
|
||
stack.push(obj);
|
||
canonicalizedObj = {};
|
||
replacementStack.push(canonicalizedObj);
|
||
var sortedKeys = [],
|
||
key = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
|
||
for (key in obj) {
|
||
/* istanbul ignore else */
|
||
if (obj.hasOwnProperty(key)) {
|
||
sortedKeys.push(key);
|
||
}
|
||
}
|
||
sortedKeys.sort();
|
||
for (i = 0; i < sortedKeys.length; i += 1) {
|
||
key = sortedKeys[i];
|
||
canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack);
|
||
}
|
||
stack.pop();
|
||
replacementStack.pop();
|
||
} else {
|
||
canonicalizedObj = obj;
|
||
}
|
||
return canonicalizedObj;
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kaWZmL2pzb24uanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7OztnQ0FtQmdCO3lEQUtBOztBQXhCaEI7Ozs7OztBQUNBOzs7Ozs7O0FBRUEsSUFBTSwwQkFBMEIsT0FBTyxTQUFQLENBQWlCLFFBQWpCOztBQUd6QixJQUFNLCtFQUFXLHFFQUFYOzs7QUFHYixTQUFTLGVBQVQsR0FBMkIsSUFBM0I7O0FBRUEsU0FBUyxRQUFULEdBQW9CLGdFQUFTLFFBQVQ7QUFDcEIsU0FBUy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md0aDsgaSArPSAxKSB7XG4gICAgICBrZXkgPSBzb3J0ZWRLZXlzW2ldO1xuICAgICAgY2Fub25pY2FsaXplZE9ialtrZXldID0gY2Fub25pY2FsaXplKG9ialtrZXldLCBzdGFjaywgcmVwbGFjZW1lbnRTdGFjayk7XG4gICAgfVxuICAgIHN0YWNrLnBvcCgpO1xuICAgIHJlcGxhY2VtZW50U3RhY2sucG9wKCk7XG4gIH0gZWxzZSB7XG4gICAgY2Fub25pY2FsaXplZE9iaiA9IG9iajtcbiAgfVxuICByZXR1cm4gY2Fub25pY2FsaXplZE9iajtcbn1cbiJdfQ==
|
||
|
||
|
||
/***/ },
|
||
/* 9 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports. /*istanbul ignore end*/applyPatch = applyPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/applyPatches = applyPatches;
|
||
|
||
var /*istanbul ignore start*/_parse = __webpack_require__(10) /*istanbul ignore end*/;
|
||
|
||
var /*istanbul ignore start*/_distanceIterator = __webpack_require__(11) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
var _distanceIterator2 = _interopRequireDefault(_distanceIterator);
|
||
|
||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||
|
||
/*istanbul ignore end*/function applyPatch(source, uniDiff) {
|
||
/*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];
|
||
|
||
if (typeof uniDiff === 'string') {
|
||
uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
|
||
}
|
||
|
||
if (Array.isArray(uniDiff)) {
|
||
if (uniDiff.length > 1) {
|
||
throw new Error('applyPatch only works with a single input.');
|
||
}
|
||
|
||
uniDiff = uniDiff[0];
|
||
}
|
||
|
||
// Apply the diff to the input
|
||
var lines = source.split('\n'),
|
||
hunks = uniDiff.hunks,
|
||
compareLine = options.compareLine || function (lineNumber, line, operation, patchContent) /*istanbul ignore start*/{
|
||
return (/*istanbul ignore end*/line === patchContent
|
||
);
|
||
},
|
||
errorCount = 0,
|
||
fuzzFactor = options.fuzzFactor || 0,
|
||
minLine = 0,
|
||
offset = 0,
|
||
removeEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
|
||
addEOFNL = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
|
||
|
||
/**
|
||
* Checks if the hunk exactly fits on the provided location
|
||
*/
|
||
function hunkFits(hunk, toPos) {
|
||
for (var j = 0; j < hunk.lines.length; j++) {
|
||
var line = hunk.lines[j],
|
||
operation = line[0],
|
||
content = line.substr(1);
|
||
|
||
if (operation === ' ' || operation === '-') {
|
||
// Context sanity check
|
||
if (!compareLine(toPos + 1, lines[toPos], operation, content)) {
|
||
errorCount++;
|
||
|
||
if (errorCount > fuzzFactor) {
|
||
return false;
|
||
}
|
||
}
|
||
toPos++;
|
||
}
|
||
}
|
||
|
||
return true;
|
||
}
|
||
|
||
// Search best fit offsets for each hunk based on the previous ones
|
||
for (var i = 0; i < hunks.length; i++) {
|
||
var hunk = hunks[i],
|
||
maxLine = lines.length - hunk.oldLines,
|
||
localOffset = 0,
|
||
toPos = offset + hunk.oldStart - 1;
|
||
|
||
var iterator = /*istanbul ignore start*/(0, _distanceIterator2.default) /*istanbul ignore end*/(toPos, minLine, maxLine);
|
||
|
||
for (; localOffset !== undefined; localOffset = iterator()) {
|
||
if (hunkFits(hunk, toPos + localOffset)) {
|
||
hunk.offset = offset += localOffset;
|
||
break;
|
||
}
|
||
}
|
||
|
||
if (localOffset === undefined) {
|
||
return false;
|
||
}
|
||
|
||
// Set lower text limit to end of the current hunk, so next ones don't try
|
||
// to fit over already patched text
|
||
minLine = hunk.offset + hunk.oldStart + hunk.oldLines;
|
||
}
|
||
|
||
// Apply patch hunks
|
||
for (var _i = 0; _i < hunks.length; _i++) {
|
||
var _hunk = hunks[_i],
|
||
_toPos = _hunk.offset + _hunk.newStart - 1;
|
||
|
||
for (var j = 0; j < _hunk.lines.length; j++) {
|
||
var line = _hunk.lines[j],
|
||
operation = line[0],
|
||
content = line.substr(1);
|
||
|
||
if (operation === ' ') {
|
||
_toPos++;
|
||
} else if (operation === '-') {
|
||
lines.splice(_toPos, 1);
|
||
/* istanbul ignore else */
|
||
} else if (operation === '+') {
|
||
lines.splice(_toPos, 0, content);
|
||
_toPos++;
|
||
} else if (operation === '\\') {
|
||
var previousOperation = _hunk.lines[j - 1] ? _hunk.lines[j - 1][0] : null;
|
||
if (previousOperation === '+') {
|
||
removeEOFNL = true;
|
||
} else if (previousOperation === '-') {
|
||
addEOFNL = true;
|
||
}
|
||
}
|
||
}
|
||
}
|
||
|
||
// Handle EOFNL insertion/removal
|
||
if (removeEOFNL) {
|
||
while (!lines[lines.length - 1]) {
|
||
lines.pop();
|
||
}
|
||
} else if (addEOFNL) {
|
||
lines.push('');
|
||
}
|
||
return lines.join('\n');
|
||
}
|
||
|
||
// Wrapper that supports multiple file patches via callbacks.
|
||
function applyPatches(uniDiff, options) {
|
||
if (typeof uniDiff === 'string') {
|
||
uniDiff = /*istanbul ignore start*/(0, _parse.parsePatch) /*istanbul ignore end*/(uniDiff);
|
||
}
|
||
|
||
var currentIndex = 0;
|
||
function processIndex() {
|
||
var index = uniDiff[currentIndex++];
|
||
if (!index) {
|
||
return options.complete();
|
||
}
|
||
|
||
options.loadFile(index, function (err, data) {
|
||
if (err) {
|
||
return options.complete(err);
|
||
}
|
||
|
||
var updatedContent = applyPatch(data, index, options);
|
||
options.patched(index, updatedContent);
|
||
|
||
setTimeout(processIndex, 0);
|
||
});
|
||
}
|
||
processIndex();
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9hcHBseS5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7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3RhcnQgLSAxO1xuXG4gICAgZm9yIChsZXQgaiA9IDA7IGogPCBodW5rLmxpbmVzLmxlbmd0aDsgaisrKSB7XG4gICAgICBsZXQgbGluZSA9IGh1bmsubGluZXNbal0sXG4gICAgICAgICAgb3BlcmF0aW9uID0gbGluZVswXSxcbiAgICAgICAgICBjb250ZW50ID0gbGluZS5zdWJzdHIoMSk7XG5cbiAgICAgIGlmIChvcGVyYXRpb24gPT09ICcgJykge1xuICAgICAgICB0b1BvcysrO1xuICAgICAgfSBlbHNlIGlmIChvcGVyYXRpb24gPT09ICctJykge1xuICAgICAgICBsaW5lcy5zcGxpY2UodG9Qb3MsIDEpO1xuICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnKycpIHtcbiAgICAgICAgbGluZXMuc3BsaWNlKHRvUG9zLCAwLCBjb250ZW50KTtcbiAgICAgICAgdG9Qb3MrKztcbiAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgbGV0IHByZXZpb3VzT3BlcmF0aW9uID0gaHVuay5saW5lc1tqIC0gMV0gPyBodW5rLmxpbmVzW2ogLSAxXVswXSA6IG51bGw7XG4gICAgICAgIGlmIChwcmV2aW91c09wZXJhdGlvbiA9PT0gJysnKSB7XG4gICAgICAgICAgcmVtb3ZlRU9GTkwgPSB0cnVlO1xuICAgICAgICB9IGVsc2UgaWYgKHByZXZpb3VzT3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgICBhZGRFT0ZOTCA9IHRydWU7XG4gICAgICAgIH1cbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICAvLyBIYW5kbGUgRU9GTkwgaW5zZXJ0aW9uL3JlbW92YWxcbiAgaWYgKHJlbW92ZUVPRk5MKSB7XG4gICAgd2hpbGUgKCFsaW5lc1tsaW5lcy5sZW5ndGggLSAxXSkge1xuICAgICAgbGluZXMucG9wKCk7XG4gICAgfVxuICB9IGVsc2UgaWYgKGFkZEVPRk5MKSB7XG4gICAgbGluZXMucHVzaCgnJyk7XG4gIH1cbiAgcmV0dXJuIGxpbmVzLmpvaW4oJ1xcbicpO1xufVxuXG4vLyBXcmFwcGVyIHRoYXQgc3VwcG9ydHMgbXVsdGlwbGUgZmlsZSBwYXRjaGVzIHZpYSBjYWxsYmFja3MuXG5leHBvcnQgZnVuY3Rpb24gYXBwbHlQYXRjaGVzKHVuaURpZmYsIG9wdGlvbnMpIHtcbiAgaWYgKHR5cGVvZiB1bmlEaWZmID09PSAnc3RyaW5nJykge1xuICAgIHVuaURpZmYgPSBwYXJzZVBhdGNoKHVuaURpZmYpO1xuICB9XG5cbiAgbGV0IGN1cnJlbnRJbmRleCA9IDA7XG4gIGZ1bmN0aW9uIHByb2Nlc3NJbmRleCgpIHtcbiAgICBsZXQgaW5kZXggPSB1bmlEaWZmW2N1cnJlbnRJbmRleCsrXTtcbiAgICBpZiAoIWluZGV4KSB7XG4gICAgICByZXR1cm4gb3B0aW9ucy5jb21wbGV0ZSgpO1xuICAgIH1cblxuICAgIG9wdGlvbnMubG9hZEZpbGUoaW5kZXgsIGZ1bmN0aW9uKGVyciwgZGF0YSkge1xuICAgICAgaWYgKGVycikge1xuICAgICAgICByZXR1cm4gb3B0aW9ucy5jb21wbGV0ZShlcnIpO1xuICAgICAgfVxuXG4gICAgICBsZXQgdXBkYXRlZENvbnRlbnQgPSBhcHBseVBhdGNoKGRhdGEsIGluZGV4LCBvcHRpb25zKTtcbiAgICAgIG9wdGlvbnMucGF0Y2hlZChpbmRleCwgdXBkYXRlZENvbnRlbnQpO1xuXG4gICAgICBzZXRUaW1lb3V0KHByb2Nlc3NJbmRleCwgMCk7XG4gICAgfSk7XG4gIH1cbiAgcHJvY2Vzc0luZGV4KCk7XG59XG4iXX0=
|
||
|
||
|
||
/***/ },
|
||
/* 10 */
|
||
/***/ function(module, exports) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports. /*istanbul ignore end*/parsePatch = parsePatch;
|
||
function parsePatch(uniDiff) {
|
||
/*istanbul ignore start*/var /*istanbul ignore end*/options = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];
|
||
|
||
var diffstr = uniDiff.split('\n'),
|
||
list = [],
|
||
i = 0;
|
||
|
||
function parseIndex() {
|
||
var index = {};
|
||
list.push(index);
|
||
|
||
// Parse diff metadata
|
||
while (i < diffstr.length) {
|
||
var line = diffstr[i];
|
||
|
||
// File header found, end parsing diff metadata
|
||
if (/^(\-\-\-|\+\+\+|@@)\s/.test(line)) {
|
||
break;
|
||
}
|
||
|
||
// Diff index
|
||
var header = /^(?:Index:|diff(?: -r \w+)+)\s+(.+?)\s*$/.exec(line);
|
||
if (header) {
|
||
index.index = header[1];
|
||
}
|
||
|
||
i++;
|
||
}
|
||
|
||
// Parse file headers if they are defined. Unified diff requires them, but
|
||
// there's no technical issues to have an isolated hunk without file header
|
||
parseFileHeader(index);
|
||
parseFileHeader(index);
|
||
|
||
// Parse hunks
|
||
index.hunks = [];
|
||
|
||
while (i < diffstr.length) {
|
||
var _line = diffstr[i];
|
||
|
||
if (/^(Index:|diff|\-\-\-|\+\+\+)\s/.test(_line)) {
|
||
break;
|
||
} else if (/^@@/.test(_line)) {
|
||
index.hunks.push(parseHunk());
|
||
} else if (_line && options.strict) {
|
||
// Ignore unexpected content unless in strict mode
|
||
throw new Error('Unknown line ' + (i + 1) + ' ' + JSON.stringify(_line));
|
||
} else {
|
||
i++;
|
||
}
|
||
}
|
||
}
|
||
|
||
// Parses the --- and +++ headers, if none are found, no lines
|
||
// are consumed.
|
||
function parseFileHeader(index) {
|
||
var fileHeader = /^(\-\-\-|\+\+\+)\s+(\S*)\s?(.*?)\s*$/.exec(diffstr[i]);
|
||
if (fileHeader) {
|
||
var keyPrefix = fileHeader[1] === '---' ? 'old' : 'new';
|
||
index[keyPrefix + 'FileName'] = fileHeader[2];
|
||
index[keyPrefix + 'Header'] = fileHeader[3];
|
||
|
||
i++;
|
||
}
|
||
}
|
||
|
||
// Parses a hunk
|
||
// This assumes that we are at the start of a hunk.
|
||
function parseHunk() {
|
||
var chunkHeaderIndex = i,
|
||
chunkHeaderLine = diffstr[i++],
|
||
chunkHeader = chunkHeaderLine.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/);
|
||
|
||
var hunk = {
|
||
oldStart: +chunkHeader[1],
|
||
oldLines: +chunkHeader[2] || 1,
|
||
newStart: +chunkHeader[3],
|
||
newLines: +chunkHeader[4] || 1,
|
||
lines: []
|
||
};
|
||
|
||
var addCount = 0,
|
||
removeCount = 0;
|
||
for (; i < diffstr.length; i++) {
|
||
var operation = diffstr[i][0];
|
||
|
||
if (operation === '+' || operation === '-' || operation === ' ' || operation === '\\') {
|
||
hunk.lines.push(diffstr[i]);
|
||
|
||
if (operation === '+') {
|
||
addCount++;
|
||
} else if (operation === '-') {
|
||
removeCount++;
|
||
} else if (operation === ' ') {
|
||
addCount++;
|
||
removeCount++;
|
||
}
|
||
} else {
|
||
break;
|
||
}
|
||
}
|
||
|
||
// Handle the empty block count case
|
||
if (!addCount && hunk.newLines === 1) {
|
||
hunk.newLines = 0;
|
||
}
|
||
if (!removeCount && hunk.oldLines === 1) {
|
||
hunk.oldLines = 0;
|
||
}
|
||
|
||
// Perform optional sanity checking
|
||
if (options.strict) {
|
||
if (addCount !== hunk.newLines) {
|
||
throw new Error('Added line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
|
||
}
|
||
if (removeCount !== hunk.oldLines) {
|
||
throw new Error('Removed line count did not match for hunk at line ' + (chunkHeaderIndex + 1));
|
||
}
|
||
}
|
||
|
||
return hunk;
|
||
}
|
||
|
||
while (i < diffstr.length) {
|
||
parseIndex();
|
||
}
|
||
|
||
return list;
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9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DEsXG4gICAgICBuZXdTdGFydDogK2NodW5rSGVhZGVyWzNdLFxuICAgICAgbmV3TGluZXM6ICtjaHVua0hlYWRlcls0XSB8fCAxLFxuICAgICAgbGluZXM6IFtdXG4gICAgfTtcblxuICAgIGxldCBhZGRDb3VudCA9IDAsXG4gICAgICAgIHJlbW92ZUNvdW50ID0gMDtcbiAgICBmb3IgKDsgaSA8IGRpZmZzdHIubGVuZ3RoOyBpKyspIHtcbiAgICAgIGxldCBvcGVyYXRpb24gPSBkaWZmc3RyW2ldWzBdO1xuXG4gICAgICBpZiAob3BlcmF0aW9uID09PSAnKycgfHwgb3BlcmF0aW9uID09PSAnLScgfHwgb3BlcmF0aW9uID09PSAnICcgfHwgb3BlcmF0aW9uID09PSAnXFxcXCcpIHtcbiAgICAgICAgaHVuay5saW5lcy5wdXNoKGRpZmZzdHJbaV0pO1xuXG4gICAgICAgIGlmIChvcGVyYXRpb24gPT09ICcrJykge1xuICAgICAgICAgIGFkZENvdW50Kys7XG4gICAgICAgIH0gZWxzZSBpZiAob3BlcmF0aW9uID09PSAnLScpIHtcbiAgICAgICAgICByZW1vdmVDb3VudCsrO1xuICAgICAgICB9IGVsc2UgaWYgKG9wZXJhdGlvbiA9PT0gJyAnKSB7XG4gICAgICAgICAgYWRkQ291bnQrKztcbiAgICAgICAgICByZW1vdmVDb3VudCsrO1xuICAgICAgICB9XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBicmVhaztcbiAgICAgIH1cbiAgICB9XG5cbiAgICAvLyBIYW5kbGUgdGhlIGVtcHR5IGJsb2NrIGNvdW50IGNhc2VcbiAgICBpZiAoIWFkZENvdW50ICYmIGh1bmsubmV3TGluZXMgPT09IDEpIHtcbiAgICAgIGh1bmsubmV3TGluZXMgPSAwO1xuICAgIH1cbiAgICBpZiAoIXJlbW92ZUNvdW50ICYmIGh1bmsub2xkTGluZXMgPT09IDEpIHtcbiAgICAgIGh1bmsub2xkTGluZXMgPSAwO1xuICAgIH1cblxuICAgIC8vIFBlcmZvcm0gb3B0aW9uYWwgc2FuaXR5IGNoZWNraW5nXG4gICAgaWYgKG9wdGlvbnMuc3RyaWN0KSB7XG4gICAgICBpZiAoYWRkQ291bnQgIT09IGh1bmsubmV3TGluZXMpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdBZGRlZCBsaW5lIGNvdW50IGRpZCBub3QgbWF0Y2ggZm9yIGh1bmsgYXQgbGluZSAnICsgKGNodW5rSGVhZGVySW5kZXggKyAxKSk7XG4gICAgICB9XG4gICAgICBpZiAocmVtb3ZlQ291bnQgIT09IGh1bmsub2xkTGluZXMpIHtcbiAgICAgICAgdGhyb3cgbmV3IEVycm9yKCdSZW1vdmVkIGxpbmUgY291bnQgZGlkIG5vdCBtYXRjaCBmb3IgaHVuayBhdCBsaW5lICcgKyAoY2h1bmtIZWFkZXJJbmRleCArIDEpKTtcbiAgICAgIH1cbiAgICB9XG5cbiAgICByZXR1cm4gaHVuaztcbiAgfVxuXG4gIHdoaWxlIChpIDwgZGlmZnN0ci5sZW5ndGgpIHtcbiAgICBwYXJzZUluZGV4KCk7XG4gIH1cblxuICByZXR1cm4gbGlzdDtcbn1cbiJdfQ==
|
||
|
||
|
||
/***/ },
|
||
/* 11 */
|
||
/***/ function(module, exports) {
|
||
|
||
/*istanbul ignore start*/"use strict";
|
||
|
||
exports.__esModule = true;
|
||
|
||
exports.default = /*istanbul ignore end*/function (start, minLine, maxLine) {
|
||
var wantForward = true,
|
||
backwardExhausted = false,
|
||
forwardExhausted = false,
|
||
localOffset = 1;
|
||
|
||
return function iterator() {
|
||
if (wantForward && !forwardExhausted) {
|
||
if (backwardExhausted) {
|
||
localOffset++;
|
||
} else {
|
||
wantForward = false;
|
||
}
|
||
|
||
// Check if trying to fit beyond text length, and if not, check it fits
|
||
// after offset location (or desired location on first iteration)
|
||
if (start + localOffset <= maxLine) {
|
||
return localOffset;
|
||
}
|
||
|
||
forwardExhausted = true;
|
||
}
|
||
|
||
if (!backwardExhausted) {
|
||
if (!forwardExhausted) {
|
||
wantForward = true;
|
||
}
|
||
|
||
// Check if trying to fit before text beginning, and if not, check it fits
|
||
// before offset location
|
||
if (minLine <= start - localOffset) {
|
||
return - localOffset++;
|
||
}
|
||
|
||
backwardExhausted = true;
|
||
return iterator();
|
||
}
|
||
|
||
// We tried to fit hunk before text beginning and beyond text lenght, then
|
||
// hunk can't fit on the text. Return undefined
|
||
};
|
||
};
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2Rpc3RhbmNlLWl0ZXJhdG9yLmpzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7eUNBR2UsVUFBUyxLQUFULEVBQWdCLE9BQWhCLEVBQXlCLE9BQXpCLEVBQWtDO0FBQy9DLE1BQUksY0FBYyxJQUFkO01BQ0Esb0JBQW9CLEtBQXBCO01BQ0EsbUJBQW1CLEtBQW5CO01BQ0EsY0FBYyxDQUFkLENBSjJDOztBQU0vQyxTQUFPLFNBQVMsUUFBVCxHQUFvQjtBQUN6QixRQUFJLGVBQWUsQ0FBQyxnQkFBRCxFQUFtQjtBQUNwQyxVQUFJLGlCQUFKLEVBQXVCO0FBQ3JCLHNCQURxQjtPQUF2QixNQUVPO0FBQ0wsc0JBQWMsS0FBZCxDQURLO09BRlA7Ozs7QUFEb0MsVUFTaEMsUUFBUSxXQUFSLElBQXVCLE9BQXZCLEVBQWdDO0FBQ2xDLGVBQU8sV0FBUCxDQURrQztPQUFwQzs7QUFJQSx5QkFBbUIsSUFBbkIsQ0Fib0M7S0FBdEM7O0FBZ0JBLFFBQUksQ0FBQyxpQkFBRCxFQUFvQjtBQUN0QixVQUFJLENBQUMsZ0JBQUQsRUFBbUI7QUFDckIsc0JBQWMsSUFBZCxDQURxQjtPQUF2Qjs7OztBQURzQixVQU9sQixXQUFXLFFBQVEsV0FBUixFQUFxQjtBQUNsQyxlQUFPLEVBQUMsYUFBRCxD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gbG9jYXRpb24gb24gZmlyc3QgaXRlcmF0aW9uKVxuICAgICAgaWYgKHN0YXJ0ICsgbG9jYWxPZmZzZXQgPD0gbWF4TGluZSkge1xuICAgICAgICByZXR1cm4gbG9jYWxPZmZzZXQ7XG4gICAgICB9XG5cbiAgICAgIGZvcndhcmRFeGhhdXN0ZWQgPSB0cnVlO1xuICAgIH1cblxuICAgIGlmICghYmFja3dhcmRFeGhhdXN0ZWQpIHtcbiAgICAgIGlmICghZm9yd2FyZEV4aGF1c3RlZCkge1xuICAgICAgICB3YW50Rm9yd2FyZCA9IHRydWU7XG4gICAgICB9XG5cbiAgICAgIC8vIENoZWNrIGlmIHRyeWluZyB0byBmaXQgYmVmb3JlIHRleHQgYmVnaW5uaW5nLCBhbmQgaWYgbm90LCBjaGVjayBpdCBmaXRzXG4gICAgICAvLyBiZWZvcmUgb2Zmc2V0IGxvY2F0aW9uXG4gICAgICBpZiAobWluTGluZSA8PSBzdGFydCAtIGxvY2FsT2Zmc2V0KSB7XG4gICAgICAgIHJldHVybiAtbG9jYWxPZmZzZXQrKztcbiAgICAgIH1cblxuICAgICAgYmFja3dhcmRFeGhhdXN0ZWQgPSB0cnVlO1xuICAgICAgcmV0dXJuIGl0ZXJhdG9yKCk7XG4gICAgfVxuXG4gICAgLy8gV2UgdHJpZWQgdG8gZml0IGh1bmsgYmVmb3JlIHRleHQgYmVnaW5uaW5nIGFuZCBiZXlvbmQgdGV4dCBsZW5naHQsIHRoZW5cbiAgICAvLyBodW5rIGNhbid0IGZpdCBvbiB0aGUgdGV4dC4gUmV0dXJuIHVuZGVmaW5lZFxuICB9O1xufVxuIl19
|
||
|
||
|
||
/***/ },
|
||
/* 12 */
|
||
/***/ function(module, exports, __webpack_require__) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports. /*istanbul ignore end*/structuredPatch = structuredPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/createTwoFilesPatch = createTwoFilesPatch;
|
||
/*istanbul ignore start*/exports. /*istanbul ignore end*/createPatch = createPatch;
|
||
|
||
var /*istanbul ignore start*/_line = __webpack_require__(5) /*istanbul ignore end*/;
|
||
|
||
/*istanbul ignore start*/
|
||
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
||
|
||
/*istanbul ignore end*/function structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
||
if (!options) {
|
||
options = { context: 4 };
|
||
}
|
||
|
||
var diff = /*istanbul ignore start*/(0, _line.diffLines) /*istanbul ignore end*/(oldStr, newStr);
|
||
diff.push({ value: '', lines: [] }); // Append an empty value to make cleanup easier
|
||
|
||
function contextLines(lines) {
|
||
return lines.map(function (entry) {
|
||
return ' ' + entry;
|
||
});
|
||
}
|
||
|
||
var hunks = [];
|
||
var oldRangeStart = 0,
|
||
newRangeStart = 0,
|
||
curRange = [],
|
||
oldLine = 1,
|
||
newLine = 1;
|
||
/*istanbul ignore start*/
|
||
var _loop = function _loop( /*istanbul ignore end*/i) {
|
||
var current = diff[i],
|
||
lines = current.lines || current.value.replace(/\n$/, '').split('\n');
|
||
current.lines = lines;
|
||
|
||
if (current.added || current.removed) {
|
||
/*istanbul ignore start*/
|
||
var _curRange;
|
||
|
||
/*istanbul ignore end*/
|
||
// If we have previous context, start with that
|
||
if (!oldRangeStart) {
|
||
var prev = diff[i - 1];
|
||
oldRangeStart = oldLine;
|
||
newRangeStart = newLine;
|
||
|
||
if (prev) {
|
||
curRange = options.context > 0 ? contextLines(prev.lines.slice(-options.context)) : [];
|
||
oldRangeStart -= curRange.length;
|
||
newRangeStart -= curRange.length;
|
||
}
|
||
}
|
||
|
||
// Output our changes
|
||
/*istanbul ignore start*/(_curRange = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/lines.map(function (entry) {
|
||
return (current.added ? '+' : '-') + entry;
|
||
})));
|
||
|
||
// Track the updated file position
|
||
if (current.added) {
|
||
newLine += lines.length;
|
||
} else {
|
||
oldLine += lines.length;
|
||
}
|
||
} else {
|
||
// Identical context lines. Track line changes
|
||
if (oldRangeStart) {
|
||
// Close out any changes that have been output (or join overlapping)
|
||
if (lines.length <= options.context * 2 && i < diff.length - 2) {
|
||
/*istanbul ignore start*/
|
||
var _curRange2;
|
||
|
||
/*istanbul ignore end*/
|
||
// Overlapping
|
||
/*istanbul ignore start*/(_curRange2 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange2 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines)));
|
||
} else {
|
||
/*istanbul ignore start*/
|
||
var _curRange3;
|
||
|
||
/*istanbul ignore end*/
|
||
// end the range and output
|
||
var contextSize = Math.min(lines.length, options.context);
|
||
/*istanbul ignore start*/(_curRange3 = /*istanbul ignore end*/curRange).push. /*istanbul ignore start*/apply /*istanbul ignore end*/( /*istanbul ignore start*/_curRange3 /*istanbul ignore end*/, /*istanbul ignore start*/_toConsumableArray( /*istanbul ignore end*/contextLines(lines.slice(0, contextSize))));
|
||
|
||
var hunk = {
|
||
oldStart: oldRangeStart,
|
||
oldLines: oldLine - oldRangeStart + contextSize,
|
||
newStart: newRangeStart,
|
||
newLines: newLine - newRangeStart + contextSize,
|
||
lines: curRange
|
||
};
|
||
if (i >= diff.length - 2 && lines.length <= options.context) {
|
||
// EOF is inside this hunk
|
||
var oldEOFNewline = /\n$/.test(oldStr);
|
||
var newEOFNewline = /\n$/.test(newStr);
|
||
if (lines.length == 0 && !oldEOFNewline) {
|
||
// special case: old has no eol and no trailing context; no-nl can end up before adds
|
||
curRange.splice(hunk.oldLines, 0, '\\ No newline at end of file');
|
||
} else if (!oldEOFNewline || !newEOFNewline) {
|
||
curRange.push('\\ No newline at end of file');
|
||
}
|
||
}
|
||
hunks.push(hunk);
|
||
|
||
oldRangeStart = 0;
|
||
newRangeStart = 0;
|
||
curRange = [];
|
||
}
|
||
}
|
||
oldLine += lines.length;
|
||
newLine += lines.length;
|
||
}
|
||
};
|
||
|
||
for (var i = 0; i < diff.length; i++) {
|
||
/*istanbul ignore start*/
|
||
_loop( /*istanbul ignore end*/i);
|
||
}
|
||
|
||
return {
|
||
oldFileName: oldFileName, newFileName: newFileName,
|
||
oldHeader: oldHeader, newHeader: newHeader,
|
||
hunks: hunks
|
||
};
|
||
}
|
||
|
||
function createTwoFilesPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options) {
|
||
var diff = structuredPatch(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader, options);
|
||
|
||
var ret = [];
|
||
if (oldFileName == newFileName) {
|
||
ret.push('Index: ' + oldFileName);
|
||
}
|
||
ret.push('===================================================================');
|
||
ret.push('--- ' + diff.oldFileName + (typeof diff.oldHeader === 'undefined' ? '' : '\t' + diff.oldHeader));
|
||
ret.push('+++ ' + diff.newFileName + (typeof diff.newHeader === 'undefined' ? '' : '\t' + diff.newHeader));
|
||
|
||
for (var i = 0; i < diff.hunks.length; i++) {
|
||
var hunk = diff.hunks[i];
|
||
ret.push('@@ -' + hunk.oldStart + ',' + hunk.oldLines + ' +' + hunk.newStart + ',' + hunk.newLines + ' @@');
|
||
ret.push.apply(ret, hunk.lines);
|
||
}
|
||
|
||
return ret.join('\n') + '\n';
|
||
}
|
||
|
||
function createPatch(fileName, oldStr, newStr, oldHeader, newHeader, options) {
|
||
return createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader, options);
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wYXRjaC9jcmVhdGUuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncy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4gICAgICAgICAgY3VyUmFuZ2UucHVzaCguLi4gY29udGV4dExpbmVzKGxpbmVzKSk7XG4gICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgLy8gZW5kIHRoZSByYW5nZSBhbmQgb3V0cHV0XG4gICAgICAgICAgbGV0IGNvbnRleHRTaXplID0gTWF0aC5taW4obGluZXMubGVuZ3RoLCBvcHRpb25zLmNvbnRleHQpO1xuICAgICAgICAgIGN1clJhbmdlLnB1c2goLi4uIGNvbnRleHRMaW5lcyhsaW5lcy5zbGljZSgwLCBjb250ZXh0U2l6ZSkpKTtcblxuICAgICAgICAgIGxldCBodW5rID0ge1xuICAgICAgICAgICAgb2xkU3RhcnQ6IG9sZFJhbmdlU3RhcnQsXG4gICAgICAgICAgICBvbGRMaW5lczogKG9sZExpbmUgLSBvbGRSYW5nZVN0YXJ0ICsgY29udGV4dFNpemUpLFxuICAgICAgICAgICAgbmV3U3RhcnQ6IG5ld1JhbmdlU3RhcnQsXG4gICAgICAgICAgICBuZXdMaW5lczogKG5ld0xpbmUgLSBuZXdSYW5nZVN0YXJ0ICsgY29udGV4dFNpemUpLFxuICAgICAgICAgICAgbGluZXM6IGN1clJhbmdlXG4gICAgICAgICAgfTtcbiAgICAgICAgICBpZiAoaSA+PSBkaWZmLmxlbmd0aCAtIDIgJiYgbGluZXMubGVuZ3RoIDw9IG9wdGlvbnMuY29udGV4dCkge1xuICAgICAgICAgICAgLy8gRU9GIGlzIGluc2lkZSB0aGlzIGh1bmtcbiAgICAgICAgICAgIGxldCBvbGRFT0ZOZXdsaW5lID0gKC9cXG4kLy50ZXN0KG9sZFN0cikpO1xuICAgICAgICAgICAgbGV0IG5ld0VPRk5ld2xpbmUgPSAoL1xcbiQvLnRlc3QobmV3U3RyKSk7XG4gICAgICAgICAgICBpZiAobGluZXMubGVuZ3RoID09IDAgJiYgIW9sZEVPRk5ld2xpbmUpIHtcbiAgICAgICAgICAgICAgLy8gc3BlY2lhbCBjYXNlOiBvbGQgaGFzIG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IZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucykge1xuICByZXR1cm4gY3JlYXRlVHdvRmlsZXNQYXRjaChmaWxlTmFtZSwgZmlsZU5hbWUsIG9sZFN0ciwgbmV3U3RyLCBvbGRIZWFkZXIsIG5ld0hlYWRlciwgb3B0aW9ucyk7XG59XG4iXX0=
|
||
|
||
|
||
/***/ },
|
||
/* 13 */
|
||
/***/ function(module, exports) {
|
||
|
||
/*istanbul ignore start*/"use strict";
|
||
|
||
exports.__esModule = true;
|
||
exports. /*istanbul ignore end*/convertChangesToDMP = convertChangesToDMP;
|
||
// See: http://code.google.com/p/google-diff-match-patch/wiki/API
|
||
function convertChangesToDMP(changes) {
|
||
var ret = [],
|
||
change = /*istanbul ignore start*/void 0 /*istanbul ignore end*/,
|
||
operation = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
|
||
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;
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L2RtcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQ2dCOztBQUFULFNBQVMsbUJBQVQsQ0FBNkIsT0FBN0IsRUFBc0M7QUFDM0MsTUFBSSxNQUFNLEVBQU47TUFDQSxnRUFESjtNQUVJLG1FQUZKLENBRDJDO0FBSTNDLE9BQUssSUFBSSxJQUFJLENBQUosRUFBTyxJQUFJLFFBQVEsTUFBUixFQUFnQixHQUFwQyxFQUF5QztBQUN2QyxhQUFTLFFBQVEsQ0FBUixDQUFULENBRHVDO0FBRXZDLFFBQUksT0FBTyxLQUFQLEVBQWM7QUFDaEIsa0JBQVksQ0FBWixDQURnQjtLQUFsQixNQUVPLElBQUksT0FBTyxPQUFQLEVBQWdCO0FBQ3pCLGtCQUFZLENBQUMsQ0FBRCxDQURhO0tBQXBCLE1BRUE7QUFDTCxrQkFBWSxDQUFaLENBREs7S0FGQTs7QUFNUCxRQUFJLElBQUosQ0FBUyxDQUFDLFNBQUQsRUFBWSxPQUFPLEtBQVAsQ0FBckIsRUFWdUM7R0FBekM7QUFZQSxTQUFPLEdBQVAsQ0FoQjJDO0NBQXRDIiwiZmlsZSI6ImRtcC5qcyIsInNvdXJjZXNDb250ZW50IjpbIi8vIFNlZTogaHR0cDovL2NvZGUuZ29vZ2xlLmNvbS9wL2dvb2dsZS1kaWZmLW1hdGNoLXBhdGNoL3dpa2kvQVBJXG5leHBvcnQgZnVuY3Rpb24gY29udmVydENoYW5nZXNUb0RNUChjaGFuZ2VzKSB7XG4gIGxldCByZXQgPSBbXSxcbiAgICAgIGNoYW5nZSxcbiAgICAgIG9wZXJhdGlvbjtcbiAgZm9yIChsZXQgaSA9IDA7IGkgPCBjaGFuZ2VzLmxlbmd0aDsgaSsrKSB7XG4gICAgY2hhbmdlID0gY2hhbmdlc1tpXTtcbiAgICBpZiAoY2hhbmdlLmFkZGVkKSB7XG4gICAgICBvcGVyYXRpb24gPSAxO1xuICAgIH0gZWxzZSBpZiAoY2hhbmdlLnJlbW92ZWQpIHtcbiAgICAgIG9wZXJhdGlvbiA9IC0xO1xuICAgIH0gZWxzZSB7XG4gICAgICBvcGVyYXRpb24gPSAwO1xuICAgIH1cblxuICAgIHJldC5wdXNoKFtvcGVyYXRpb24sIGNoYW5nZS52YWx1ZV0pO1xuICB9XG4gIHJldHVybiByZXQ7XG59XG4iXX0=
|
||
|
||
|
||
/***/ },
|
||
/* 14 */
|
||
/***/ function(module, exports) {
|
||
|
||
/*istanbul ignore start*/'use strict';
|
||
|
||
exports.__esModule = true;
|
||
exports. /*istanbul ignore end*/convertChangesToXML = convertChangesToXML;
|
||
function convertChangesToXML(changes) {
|
||
var ret = [];
|
||
for (var i = 0; i < changes.length; i++) {
|
||
var change = changes[i];
|
||
if (change.added) {
|
||
ret.push('<ins>');
|
||
} else if (change.removed) {
|
||
ret.push('<del>');
|
||
}
|
||
|
||
ret.push(escapeHTML(change.value));
|
||
|
||
if (change.added) {
|
||
ret.push('</ins>');
|
||
} else if (change.removed) {
|
||
ret.push('</del>');
|
||
}
|
||
}
|
||
return ret.join('');
|
||
}
|
||
|
||
function escapeHTML(s) {
|
||
var n = s;
|
||
n = n.replace(/&/g, '&');
|
||
n = n.replace(/</g, '<');
|
||
n = n.replace(/>/g, '>');
|
||
n = n.replace(/"/g, '"');
|
||
|
||
return n;
|
||
}
|
||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb252ZXJ0L3htbC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Z0NBQWdCO0FBQVQsU0FBUyxtQkFBVCxDQUE2QixPQUE3QixFQUFzQztBQUMzQyxNQUFJLE1BQU0sRUFBTixDQUR1QztBQUUzQyxPQUFLLElBQUksSUFBSSxDQUFKLEVBQU8sSUFBSSxRQUFRLE1BQVIsRUFBZ0IsR0FBcEMsRUFBeUM7QUFDdkMsUUFBSSxTQUFTLFFBQVEsQ0FBUixDQUFULENBRG1DO0FBRXZDLFFBQUksT0FBTyxLQUFQLEVBQWM7QUFDaEIsVUFBSSxJQUFKLENBQVMsT0FBVCxFQURnQjtLQUFsQixNQUVPLElBQUksT0FBTyxPQUFQLEVBQWdCO0FBQ3pCLFVBQUksSUFBSixDQUFTLE9BQVQsRUFEeUI7S0FBcEI7O0FBSVAsUUFBSSxJQUFKLENBQVMsV0FBVyxPQUFPLEtBQVAsQ0FBcEIsRUFSdUM7O0FBVXZDLFFBQUksT0FBTyxLQUFQLEVBQWM7QUFDaEIsVUFBSSxJQUFKLENBQVMsUUFBVCxFQURnQjtLQUFsQixNQUVPLElBQUksT0FBTyxPQUFQLE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