diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-12-10 21:51:33 +0100 |
commit | 0469abd4a9c9270a1fdc962969e36e63699af8b4 (patch) | |
tree | f9864d4a4148621378958794cbbfdc2393733283 /node_modules/diff/dist/diff.min.js | |
parent | 6947e79bbc258f7bc96af424ddb71a511f0c15a3 (diff) |
upgrade dependencies
Diffstat (limited to 'node_modules/diff/dist/diff.min.js')
-rw-r--r-- | node_modules/diff/dist/diff.min.js | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/node_modules/diff/dist/diff.min.js b/node_modules/diff/dist/diff.min.js index 5d1b40a06..7aca6f210 100644 --- a/node_modules/diff/dist/diff.min.js +++ b/node_modules/diff/dist/diff.min.js @@ -1,6 +1,6 @@ /*! - diff v3.3.0 + diff v3.4.0 Software License Agreement (BSD License) @@ -123,9 +123,10 @@ function(a,b){/*istanbul ignore start*/ if(j.value=a.join(d.slice(i,i+j.count)),i+=j.count,f&&b[f-1].added){var k=b[f-1];b[f-1]=b[f],b[f]=k}}else{if(!j.added&&e){var l=c.slice(h,h+j.count);l=l.map(function(a,b){var c=d[i+b];return c.length>a.length?c:a}),j.value=a.join(l)}else j.value=a.join(c.slice(h,h+j.count));h+=j.count, // Common case j.added||(i+=j.count)}} -// 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 m=b[g-1];return g>1&&(m.added||m.removed)&&a.equals("",m.value)&&(b[g-2].value+=m.value,b.pop()),b}function e(a){return{newPos:a.newPos,components:a.components.slice(0)}}b.__esModule=!0,b["default"]=/*istanbul ignore end*/c,c.prototype={/*istanbul ignore start*/ +// Special case handle for when one terminal is ignored (i.e. whitespace). +// For this case we merge the terminal into the prior string and drop the change. +// This is only available for string mode. +var m=b[g-1];return g>1&&"string"==typeof m.value&&(m.added||m.removed)&&a.equals("",m.value)&&(b[g-2].value+=m.value,b.pop()),b}function e(a){return{newPos:a.newPos,components:a.components.slice(0)}}b.__esModule=!0,b["default"]=/*istanbul ignore end*/c,c.prototype={/*istanbul ignore start*/ /*istanbul ignore end*/ diff:function(a,b){function c(a){return h?(setTimeout(function(){h(void 0,a)},0),!0):a} // Main worker method. checks all permutations of a given edit length for acceptance. @@ -143,7 +144,7 @@ g.newPos++,i.pushComponent(g.components,!0,void 0)),o=i.extractCommon(g,b,a,f),g n[f]=g}else // If this path is a terminal then prune n[f]=void 0}l++}/*istanbul ignore start*/ -var/*istanbul ignore end*/g=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],h=g.callback;"function"==typeof g&&(h=g,g={}),this.options=g;var i=this; +var/*istanbul ignore end*/g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},h=g.callback;"function"==typeof g&&(h=g,g={}),this.options=g;var i=this; // Allow subclasses to massage the input prior to running a=this.castInput(a),b=this.castInput(b),a=this.removeEmpty(this.tokenize(a)),b=this.removeEmpty(this.tokenize(b));var j=b.length,k=a.length,l=1,m=j+k,n=[{newPos:-1,components:[]}],o=this.extractCommon(n[0],b,a,0);if(n[0].newPos+1>=j&&o+1>=k) // Identity per the equality and tokenizer @@ -165,7 +166,7 @@ a[a.length-1]={count:d.count+1,added:b,removed:c}:a.push({count:1,added:b,remove /*istanbul ignore end*/ extractCommon:function(a,b,c,d){for(var e=b.length,f=c.length,g=a.newPos,h=g-d,i=0;g+1<e&&h+1<f&&this.equals(b[g+1],c[h+1]);)g++,h++,i++;return i&&a.components.push({count:i}),a.newPos=g,h},/*istanbul ignore start*/ /*istanbul ignore end*/ -equals:function(a,b){return a===b||this.options.ignoreCase&&a.toLowerCase()===b.toLowerCase()},/*istanbul ignore start*/ +equals:function(a,b){return this.options.comparator?this.options.comparator(a,b):a===b||this.options.ignoreCase&&a.toLowerCase()===b.toLowerCase()},/*istanbul ignore start*/ /*istanbul ignore end*/ removeEmpty:function(a){for(var b=[],c=0;c<a.length;c++)a[c]&&b.push(a[c]);return b},/*istanbul ignore start*/ /*istanbul ignore end*/ @@ -213,7 +214,7 @@ function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return l. // 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 f(a,b,c){b=b||[],c=c||[];var d=/*istanbul ignore start*/void 0;for(d=0;d<b.length;d+=1)if(b[d]===a)return c[d];var e=/*istanbul ignore start*/void 0;if("[object Array]"===k.call(a)){for(b.push(a),e=new Array(a.length),c.push(e),d=0;d<a.length;d+=1)e[d]=f(a[d],b,c);return b.pop(),c.pop(),e}if(a&&a.toJSON&&(a=a.toJSON()),/*istanbul ignore start*/"object"===("undefined"==typeof/*istanbul ignore end*/a?"undefined":g(a))&&null!==a){b.push(a),e={},c.push(e);var h=[],i=/*istanbul ignore start*/void 0;for(i in a)/* istanbul ignore else */ -a.hasOwnProperty(i)&&h.push(i);for(h.sort(),d=0;d<h.length;d+=1)i=h[d],e[i]=f(a[i],b,c);b.pop(),c.pop()}else e=a;return e}b.__esModule=!0,b.jsonDiff=void 0;var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol?"symbol":typeof a};b.diffJson=e,/*istanbul ignore start*/ +a.hasOwnProperty(i)&&h.push(i);for(h.sort(),d=0;d<h.length;d+=1)i=h[d],e[i]=f(a[i],b,c);b.pop(),c.pop()}else e=a;return e}b.__esModule=!0,b.jsonDiff=void 0;var g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};b.diffJson=e,/*istanbul ignore start*/ b.canonicalize=f;var/*istanbul ignore start*/h=c(1),i=d(h),/*istanbul ignore start*/j=c(5),k=Object.prototype.toString,l=/*istanbul ignore start*/b.jsonDiff=new/*istanbul ignore start*/i["default"]; // 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: @@ -222,7 +223,7 @@ var/*istanbul ignore end*/b=this.options.undefinedReplacement;return"string"==ty return i["default"].prototype.equals.call(l,a.replace(/,([\r\n])/g,"$1"),b.replace(/,([\r\n])/g,"$1"))}},/* 9 */ /***/ function(a,b,c){/*istanbul ignore start*/ -"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return h.diff(a,b,c)}b.__esModule=!0,b.arrayDiff=void 0,b.diffArrays=e;var/*istanbul ignore start*/f=c(1),g=d(f),h=/*istanbul ignore start*/b.arrayDiff=new/*istanbul ignore start*/g["default"];h.tokenize=h.join=function(a){return a.slice()}},/* 10 */ +"use strict";function d(a){return a&&a.__esModule?a:{"default":a}}function e(a,b,c){return h.diff(a,b,c)}b.__esModule=!0,b.arrayDiff=void 0,b.diffArrays=e;var/*istanbul ignore start*/f=c(1),g=d(f),h=/*istanbul ignore start*/b.arrayDiff=new/*istanbul ignore start*/g["default"];h.tokenize=h.join=function(a){return a.slice()},h.removeEmpty=function(a){return a}},/* 10 */ /***/ function(a,b,c){/*istanbul ignore start*/ "use strict";function d(a){return a&&a.__esModule?a:{"default":a}}/*istanbul ignore end*/ @@ -232,13 +233,15 @@ function e(a,b){/** function c(a,b){for(var c=0;c<a.lines.length;c++){var d=a.lines[c],f=d[0],g=d.substr(1);if(" "===f||"-"===f){ // Context sanity check if(!j(b+1,e[b],f,g)&&(k++,k>l))return!1;b++}}return!0}/*istanbul ignore start*/ -var/*istanbul ignore end*/d=arguments.length<=2||void 0===arguments[2]?{}:arguments[2];if("string"==typeof b&&(b=/*istanbul ignore start*/(0,g.parsePatch)(b)),Array.isArray(b)){if(b.length>1)throw new Error("applyPatch only works with a single input.");b=b[0]} +var/*istanbul ignore end*/d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"==typeof b&&(b=/*istanbul ignore start*/(0,g.parsePatch)(b)),Array.isArray(b)){if(b.length>1)throw new Error("applyPatch only works with a single input.");b=b[0]} // Search best fit offsets for each hunk based on the previous ones for(var e=a.split(/\r\n|[\n\v\f\r\x85]/),f=a.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=b.hunks,j=d.compareLine||function(a,b,c,d){/*istanbul ignore end*/ return b===d},k=0,l=d.fuzzFactor||0,m=0,n=0,o=/*istanbul ignore start*/void 0,p=/*istanbul ignore start*/void 0,q=0;q<h.length;q++){for(var r=h[q],s=e.length-r.oldLines,t=0,u=n+r.oldStart-1,v=/*istanbul ignore start*/(0,i["default"])(u,m,s);void 0!==t;t=v())if(c(r,u+t)){r.offset=n+=t;break}if(void 0===t)return!1; // Set lower text limit to end of the current hunk, so next ones don't try // to fit over already patched text -m=r.offset+r.oldStart+r.oldLines}for(var w=0,x=0;x<h.length;x++){var y=h[x],z=y.oldStart+y.offset+w-1;w+=y.newLines-y.oldLines;for(var A=0;A<y.lines.length;A++){var B=y.lines[A],C=B[0],D=B.substr(1),E=y.linedelimiters[A];if(" "===C)z++;else if("-"===C)e.splice(z,1),f.splice(z,1);else if("+"===C)e.splice(z,0,D),f.splice(z,0,E),z++;else if("\\"===C){var F=y.lines[A-1]?y.lines[A-1][0]:null;"+"===F?o=!0:"-"===F&&(p=!0)}}} +m=r.offset+r.oldStart+r.oldLines}for(var w=0,x=0;x<h.length;x++){var y=h[x],z=y.oldStart+y.offset+w-1;w+=y.newLines-y.oldLines,z<0&&( +// Creating a new file +z=0);for(var A=0;A<y.lines.length;A++){var B=y.lines[A],C=B[0],D=B.substr(1),E=y.linedelimiters[A];if(" "===C)z++;else if("-"===C)e.splice(z,1),f.splice(z,1);else if("+"===C)e.splice(z,0,D),f.splice(z,0,E),z++;else if("\\"===C){var F=y.lines[A-1]?y.lines[A-1][0]:null;"+"===F?o=!0:"-"===F&&(p=!0)}}} // Handle EOFNL insertion/removal if(o)for(;!e[e.length-1];)e.pop(),f.pop();else p&&(e.push(""),f.push("\n"));for(var G=0;G<e.length-1;G++)e[G]=e[G]+f[G];return e.join("")} // Wrapper that supports multiple file patches via callbacks. @@ -270,7 +273,7 @@ function d(){for(var a=i,b=f[i++],c=b.split(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d if( // Handle the empty block count case h||1!==d.newLines||(d.newLines=0),j||1!==d.oldLines||(d.oldLines=0),e.strict){if(h!==d.newLines)throw new Error("Added line count did not match for hunk at line "+(a+1));if(j!==d.oldLines)throw new Error("Removed line count did not match for hunk at line "+(a+1))}return d}for(/*istanbul ignore start*/ -var/*istanbul ignore end*/e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],f=a.split(/\r\n|[\n\v\f\r\x85]/),g=a.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=[],i=0;i<f.length;)b();return h}b.__esModule=!0,b.parsePatch=c},/* 12 */ +var/*istanbul ignore end*/e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=a.split(/\r\n|[\n\v\f\r\x85]/),g=a.match(/\r\n|[\n\v\f\r\x85]/g)||[],h=[],i=0;i<f.length;)b();return h}b.__esModule=!0,b.parsePatch=c},/* 12 */ /***/ function(a,b){/*istanbul ignore start*/ "use strict";b.__esModule=!0,b["default"]=/*istanbul ignore end*/function(a,b,c){var d=!0,e=!1,f=!1,g=1;return function h(){if(d&&!f){ @@ -286,7 +289,8 @@ return f||(d=!0),b<=a-g?-g++:(e=!0,h())}}},/* 13 */ function(a,b,c){/*istanbul ignore start*/ "use strict";/*istanbul ignore start*/ function d(a){if(Array.isArray(a)){for(var b=0,c=Array(a.length);b<a.length;b++)c[b]=a[b];return c}return Array.from(a)}/*istanbul ignore end*/ -function e(a){var b=!1;a.oldLines=0,a.newLines=0,a.lines.forEach(function(c){return"string"!=typeof c?void(b=!0):("+"!==c[0]&&" "!==c[0]||a.newLines++,void("-"!==c[0]&&" "!==c[0]||a.oldLines++))}),b&&(delete a.oldLines,delete a.newLines)}function f(a,b,c){a=g(a,c),b=g(b,c);var d={}; +function e(a){/*istanbul ignore start*/ +var b=/*istanbul ignore end*/v(a.lines),c=b.oldLines,d=b.newLines;void 0!==c?a.oldLines=c:delete a.oldLines,void 0!==d?a.newLines=d:delete a.newLines}function f(a,b,c){a=g(a,c),b=g(b,c);var d={}; // For index we just let it pass through as it doesn't have any necessary meaning. // Leaving sanity checks on this to the API consumer that may know more about the // meaning in their own context. @@ -303,8 +307,8 @@ d.hunks.push(k(o,m)),e++,n+=o.newLines-o.oldLines;else if(j(p,o)) d.hunks.push(k(p,n)),f++,m+=p.newLines-p.oldLines;else{ // Overlap, merge as best we can var q={oldStart:Math.min(o.oldStart,p.oldStart),oldLines:0,newStart:Math.min(o.newStart+m,p.oldStart+n),newLines:0,lines:[]};l(q,o.oldStart,o.lines,p.oldStart,p.lines),f++,e++,d.hunks.push(q)}}return d}function g(a,b){if("string"==typeof a){if(/^@@/m.test(a)||/^Index:/m.test(a))/*istanbul ignore start*/ -return(0,w.parsePatch)(a)[0];if(!b)throw new Error("Must provide a base reference or pass in a patch");/*istanbul ignore start*/ -return(0,v.structuredPatch)(void 0,void 0,b,a)}return a}function h(a){return a.newFileName&&a.newFileName!==a.oldFileName}function i(a,b,c){return b===c?b:(a.conflict=!0,{mine:b,theirs:c})}function j(a,b){return a.oldStart<b.oldStart&&a.oldStart+a.oldLines<b.oldStart}function k(a,b){return{oldStart:a.oldStart,oldLines:a.oldLines,newStart:a.newStart+b,newLines:a.newLines,lines:a.lines}}function l(a,b,c,f,g){ +return(0,x.parsePatch)(a)[0];if(!b)throw new Error("Must provide a base reference or pass in a patch");/*istanbul ignore start*/ +return(0,w.structuredPatch)(void 0,void 0,b,a)}return a}function h(a){return a.newFileName&&a.newFileName!==a.oldFileName}function i(a,b,c){return b===c?b:(a.conflict=!0,{mine:b,theirs:c})}function j(a,b){return a.oldStart<b.oldStart&&a.oldStart+a.oldLines<b.oldStart}function k(a,b){return{oldStart:a.oldStart,oldLines:a.oldLines,newStart:a.newStart+b,newLines:a.newLines,lines:a.lines}}function l(a,b,c,f,g){ // This will generally result in a conflicted hunk, but there are cases where the context // is the only overlap where we can successfully merge the content here. var h={offset:b,lines:c,index:0},i={offset:f,lines:g,index:0}; @@ -333,21 +337,21 @@ m(a,h,i)} // Now push anything that may be remaining q(a,h),q(a,i),e(a)}function m(a,b,c){var e=r(b),f=r(c);if(t(e)&&t(f)){ // Special case for remove changes that are supersets of one another -if(/*istanbul ignore start*/(0,x.arrayStartsWith)(e,f)&&u(c,e,e.length-f.length)){/*istanbul ignore start*/ +if(/*istanbul ignore start*/(0,y.arrayStartsWith)(e,f)&&u(c,e,e.length-f.length)){/*istanbul ignore start*/ var g;/*istanbul ignore end*/ /*istanbul ignore start*/ /*istanbul ignore end*/ /*istanbul ignore start*/ /*istanbul ignore start*/ /*istanbul ignore end*/ -return void(g=a.lines).push.apply(g,d(e))}if(/*istanbul ignore start*/(0,x.arrayStartsWith)(f,e)&&u(b,f,f.length-e.length)){/*istanbul ignore start*/ +return void(g=a.lines).push.apply(g,d(e))}if(/*istanbul ignore start*/(0,y.arrayStartsWith)(f,e)&&u(b,f,f.length-e.length)){/*istanbul ignore start*/ var h;/*istanbul ignore end*/ /*istanbul ignore start*/ /*istanbul ignore end*/ /*istanbul ignore start*/ /*istanbul ignore start*/ /*istanbul ignore end*/ -return void(h=a.lines).push.apply(h,d(f))}}else if(/*istanbul ignore start*/(0,x.arrayEqual)(e,f)){/*istanbul ignore start*/ +return void(h=a.lines).push.apply(h,d(f))}}else if(/*istanbul ignore start*/(0,y.arrayEqual)(e,f)){/*istanbul ignore start*/ var i;/*istanbul ignore end*/ /*istanbul ignore start*/ /*istanbul ignore end*/ @@ -364,8 +368,8 @@ var h;/*istanbul ignore end*/ if("+"===i[0])break; // Consume any additions in the other block as a conflict to attempt // to pull in the remaining context after this -if(f=f||" "!==h[0],d.push(i),e++,"+"===h[0])for(g=!0;"+"===h[0];)c.push(h),h=a.lines[++a.index];i.substr(1)===h.substr(1)?(c.push(h),a.index++):g=!0}if("+"===(b[e]||"")[0]&&f&&(g=!0),g)return c;for(;e<b.length;)d.push(b[e++]);return{merged:d,changes:c}}function t(a){return a.reduce(function(a,b){return a&&"-"===b[0]},!0)}function u(a,b,c){for(var d=0;d<c;d++){var e=b[b.length-c+d].substr(1);if(a.lines[a.index+d]!==" "+e)return!1}return a.index+=c,!0}b.__esModule=!0,b.calcLineCount=e,/*istanbul ignore start*/ -b.merge=f;var/*istanbul ignore start*/v=c(14),/*istanbul ignore start*/w=c(11),/*istanbul ignore start*/x=c(15)},/* 14 */ +if(f=f||" "!==h[0],d.push(i),e++,"+"===h[0])for(g=!0;"+"===h[0];)c.push(h),h=a.lines[++a.index];i.substr(1)===h.substr(1)?(c.push(h),a.index++):g=!0}if("+"===(b[e]||"")[0]&&f&&(g=!0),g)return c;for(;e<b.length;)d.push(b[e++]);return{merged:d,changes:c}}function t(a){return a.reduce(function(a,b){return a&&"-"===b[0]},!0)}function u(a,b,c){for(var d=0;d<c;d++){var e=b[b.length-c+d].substr(1);if(a.lines[a.index+d]!==" "+e)return!1}return a.index+=c,!0}function v(a){var b=0,c=0;return a.forEach(function(a){if("string"!=typeof a){var d=v(a.mine),e=v(a.theirs);void 0!==b&&(d.oldLines===e.oldLines?b+=d.oldLines:b=void 0),void 0!==c&&(d.newLines===e.newLines?c+=d.newLines:c=void 0)}else void 0===c||"+"!==a[0]&&" "!==a[0]||c++,void 0===b||"-"!==a[0]&&" "!==a[0]||b++}),{oldLines:b,newLines:c}}b.__esModule=!0,b.calcLineCount=e,/*istanbul ignore start*/ +b.merge=f;var/*istanbul ignore start*/w=c(14),/*istanbul ignore start*/x=c(11),/*istanbul ignore start*/y=c(15)},/* 14 */ /***/ function(a,b,c){/*istanbul ignore start*/ "use strict";/*istanbul ignore start*/ |