sanity-diff-patch
Advanced tools
Comparing version 1.0.9 to 2.0.0
@@ -5,3 +5,3 @@ 'use strict'; | ||
var diffMatchPatch = require('diff-match-patch'); | ||
var diffMatchPatch = require('@sanity/diff-match-patch'); | ||
@@ -29,3 +29,4 @@ function _extends() { | ||
subClass.prototype.constructor = subClass; | ||
subClass.__proto__ = superClass; | ||
_setPrototypeOf(subClass, superClass); | ||
} | ||
@@ -55,3 +56,3 @@ | ||
try { | ||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
@@ -214,3 +215,2 @@ } catch (e) { | ||
var ignoredKeys = ['_id', '_type', '_createdAt', '_updatedAt', '_rev']; | ||
var diff = /*#__PURE__*/new diffMatchPatch.diff_match_patch(); | ||
var defaultOptions = { | ||
@@ -447,5 +447,5 @@ hideWarnings: false, | ||
try { | ||
var patch = diff.diff_main(itemA, itemB); | ||
diff.diff_cleanupEfficiency(patch); | ||
strPatch = diff.patch_toText(diff.patch_make(patch)); | ||
var patch = diffMatchPatch.makeDiff(itemA, itemB); | ||
var diff = diffMatchPatch.cleanupEfficiency(patch); | ||
strPatch = diffMatchPatch.stringifyPatches(diffMatchPatch.makePatches(diff)); | ||
} catch (err) { | ||
@@ -452,0 +452,0 @@ // Fall back to using regular set patch |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("diff-match-patch");function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,r){return(o=i()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o}).apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return o(t,arguments,r(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,t)})(t)}function u(t){return t.reduce((function(t,e,r){if(Array.isArray(e))return t+"["+e.join(":")+"]";if("object"==typeof(n=e)&&"string"==typeof n._key)return t+'[_key=="'+e._key+'"]';var n;if("number"==typeof e)return t+"["+e+"]";if(/^\d+$/.test(e))return t+'["'+e+'"]';if("string"==typeof e)return t+(0===r?"":".")+e;throw new Error('Unsupported path segment "'+e+'"')}),"")}var c=function(t){var e,r;function n(e,r,n){var i,o=u(r);return(i=t.call(this,e+" (at '"+o+"')")||this).path=r,i.serializedPath=o,i.value=n,i}return r=t,(e=n).prototype=Object.create(r.prototype),e.prototype.constructor=e,e.__proto__=r,n}(a(Error)),f=/^[a-z0-9][a-z0-9_.-]+$/i,s=/^[a-zA-Z_][a-zA-Z0-9_]*$/,p=/^[a-z_]/i;function h(t,e,r){if(!p.test(t))throw new c("Keys must start with a letter (a-z)",r.concat(t),e);if(!s.test(t))throw new c("Keys can only contain letters, numbers and underscores",r.concat(t),e);if("_key"===t||"_ref"===t||"_type"===t){if("string"!=typeof e)throw new c("Keys must be strings",r.concat(t),e);if(!f.test(e))throw new c("Invalid key - use less exotic characters",r.concat(t),e)}return t}var l=["_id","_type","_createdAt","_updatedAt","_rev"],y=new t.diff_match_patch,d={hideWarnings:!1,diffMatchPatch:{enabled:!0,lengthThresholdAbsolute:30,lengthThresholdRelative:1.2}};function v(t,e,r,n,i){if(void 0===r&&(r=d),void 0===n&&(n=[]),void 0===i&&(i=[]),t===e)return i;var o=Array.isArray(t)?"array":typeof t,a=Array.isArray(e)?"array":typeof e,u="undefined"===o,f="undefined"===a;if(u&&!f)return i.push({op:"set",path:n,value:e}),i;if(!u&&f)return i.push({op:"unset",path:n}),i;var s=u?a:o;return"object"===s||"array"===s?o!==a?(i.push({op:"set",path:n,value:e}),i):"array"===s?function(t,e,r,n,i){if(e.length>t.length&&i.push({op:"insert",after:n.concat([-1]),items:e.slice(t.length).map((function(t,e){return w(t,n,e,r)}))}),e.length<t.length){var o=t.length-e.length==1,a=t.slice(e.length);!function(t){return Boolean(t.ifRevisionID||t.ifRevisionId)}(r)&&b(a)?i.push.apply(i,a.map((function(t){return{op:"unset",path:n.concat({_key:t._key})}}))):i.push({op:"unset",path:n.concat([o?e.length:[e.length,""]])})}for(var u=0;u<e.length;u++)if(Array.isArray(e[u]))throw new c("Multi-dimensional arrays not supported",n.concat(u),e[u]);var f=Math.min(t.length,e.length),s=t.slice(0,f),p=e.slice(0,f);return b(s)&&b(p)?function(t,e,r,n,i){var o=m(t),a=m(e);if(!function(t,e){return t.length===e.length&&t.every((function(t,r){return e[r]===t}))}(o.keys,a.keys))return g(t,e,r,n,i);for(var u=0;u<a.keys.length;u++){var c=a.keys[u];v(o.index[c],w(a.index[c],n,u,r),r,n.concat({_key:c}),i)}return i}(s,p,r,n,i):g(s,p,r,n,i)}(t,e,r,n,i):function(t,e,r,n,i){for(var o=0===n.length,a=Object.keys(t).filter(o?_:k).map((function(e){return h(e,t[e],n)})),u=a.length,c=Object.keys(e).filter(o?_:k).map((function(t){return h(t,e[t],n)})),f=c.length,s=0;s<u;s++){var p=a[s];p in e||i.push({op:"unset",path:n.concat(p)})}for(var l=0;l<f;l++){var y=c[l];v(t[y],e[y],r,n.concat([y]),i)}return i}(t,e,r,n,i):function(t,e,r,n,i){var o=function(t,e,r,n){var i=r.diffMatchPatch,o=i.lengthThresholdRelative,a=n[n.length-1];if(!(!i.enabled||"string"!=typeof t||"string"!=typeof e||"string"==typeof a&&"_"===a[0]||e.length<i.lengthThresholdAbsolute)){var u="";try{var c=y.diff_main(t,e);y.diff_cleanupEfficiency(c),u=y.patch_toText(y.patch_make(c))}catch(t){return}return u.length>e.length*o?void 0:{op:"diffMatchPatch",path:n,value:u}}}(t,e,r,n);return i.push(o||{op:"set",path:n,value:e}),i}(t,e,r,n,i)}function g(t,e,r,n,i){for(var o=0;o<t.length;o++)v(t[o],w(e[o],n,o,r),r,n.concat(o),i);return i}function _(t){return-1===l.indexOf(t)}function b(t){for(var e,r=[],n=0;n<t.length;n++){var i="object"==typeof(e=t[n])&&null!==e&&e._key;if(!i||-1!==r.indexOf(i))return!1;r.push(i)}return!0}function m(t){return t.reduce((function(t,e){return t.keys.push(e._key),t.index[e._key]=e,t}),{keys:[],index:{}})}function w(t,e,r,n){if(void 0!==t)return t;if(!n.hideWarnings){var i=u(e.concat(r));console.warn("undefined value in array converted to null (at '"+i+"')")}return null}function k(t){return!0}exports.DiffError=c,exports.diffItem=v,exports.diffPatch=function(t,r,n){var i=n?function(t){return e({},d,t,{diffMatchPatch:e({},d.diffMatchPatch,t.diffMatchPatch||{})})}(n):d,o=i.id||t._id===r._id&&t._id,a=i.ifRevisionID||i.ifRevisionId,c="boolean"==typeof a?t._rev:a,f=i.basePath||[];if(!o)throw new Error("_id on itemA and itemB not present or differs, specify document id the mutations should be applied to");if(!0===a&&!c)throw new Error("`ifRevisionID` is set to `true`, but no `_rev` was passed in item A. Either explicitly set `ifRevisionID` to a revision, or pass `_rev` as part of item A.");if(0===f.length&&t._type!==r._type)throw new Error("_type is immutable and cannot be changed ("+t._type+" => "+r._type+")");return function(t,r){if(0===t.length)return[];var n=r.id,i=r.ifRevisionID,o=t.filter((function(t){return"set"===t.op})),a=t.filter((function(t){return"unset"===t.op})),c=t.filter((function(t){return"insert"===t.op})),f=t.filter((function(t){return"diffMatchPatch"===t.op})),s=o.length>0&&o.reduce((function(t,e){var r=u(e.path);return t.set[r]=e.value,t}),{id:n,set:{}}),p=a.length>0&&a.reduce((function(t,e){var r=u(e.path);return t.unset.push(r),t}),{id:n,unset:[]}),h=c.reduce((function(t,e){var r=u(e.after);return t.concat({id:n,insert:{after:r,items:e.items}})}),[]);return[s,p,f.length>0&&f.reduce((function(t,e){var r=u(e.path);return t.diffMatchPatch[r]=e.value,t}),{id:n,diffMatchPatch:{}})].concat(h).filter((function(t){return!1!==t})).map((function(t,r){return{patch:i&&0===r?e({},t,{ifRevisionID:i}):t}}))}(v(t,r,i,f,[]),{id:o,ifRevisionID:a?c:void 0})},exports.pathToString=u,exports.validateDocument=function t(e,r){if(void 0===r&&(r=[]),Array.isArray(e))return e.every((function(e,n){if(Array.isArray(e))throw new c("Multi-dimensional arrays not supported",r.concat(n));return t(e,r.concat(n))}));if("object"==typeof e&&null!==e){var n=e;return Object.keys(n).every((function(e){return h(e,n[e],r)&&t(n[e],r.concat(e))}))}return!0}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@sanity/diff-match-patch");function e(){return(e=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}function r(t){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function o(t,e,r){return(o=i()?Reflect.construct:function(t,e,r){var i=[null];i.push.apply(i,e);var o=new(Function.bind.apply(t,i));return r&&n(o,r.prototype),o}).apply(null,arguments)}function a(t){var e="function"==typeof Map?new Map:void 0;return(a=function(t){if(null===t||-1===Function.toString.call(t).indexOf("[native code]"))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,i)}function i(){return o(t,arguments,r(this).constructor)}return i.prototype=Object.create(t.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),n(i,t)})(t)}function u(t){return t.reduce((function(t,e,r){if(Array.isArray(e))return t+"["+e.join(":")+"]";if("object"==typeof(n=e)&&"string"==typeof n._key)return t+'[_key=="'+e._key+'"]';var n;if("number"==typeof e)return t+"["+e+"]";if(/^\d+$/.test(e))return t+'["'+e+'"]';if("string"==typeof e)return t+(0===r?"":".")+e;throw new Error('Unsupported path segment "'+e+'"')}),"")}var c=function(t){var e,r;function i(e,r,n){var i,o=u(r);return(i=t.call(this,e+" (at '"+o+"')")||this).path=r,i.serializedPath=o,i.value=n,i}return r=t,(e=i).prototype=Object.create(r.prototype),e.prototype.constructor=e,n(e,r),i}(a(Error)),f=/^[a-z0-9][a-z0-9_.-]+$/i,s=/^[a-zA-Z_][a-zA-Z0-9_]*$/,p=/^[a-z_]/i;function l(t,e,r){if(!p.test(t))throw new c("Keys must start with a letter (a-z)",r.concat(t),e);if(!s.test(t))throw new c("Keys can only contain letters, numbers and underscores",r.concat(t),e);if("_key"===t||"_ref"===t||"_type"===t){if("string"!=typeof e)throw new c("Keys must be strings",r.concat(t),e);if(!f.test(e))throw new c("Invalid key - use less exotic characters",r.concat(t),e)}return t}var h=["_id","_type","_createdAt","_updatedAt","_rev"],y={hideWarnings:!1,diffMatchPatch:{enabled:!0,lengthThresholdAbsolute:30,lengthThresholdRelative:1.2}};function d(e,r,n,i,o){if(void 0===n&&(n=y),void 0===i&&(i=[]),void 0===o&&(o=[]),e===r)return o;var a=Array.isArray(e)?"array":typeof e,u=Array.isArray(r)?"array":typeof r,f="undefined"===a,s="undefined"===u;if(f&&!s)return o.push({op:"set",path:i,value:r}),o;if(!f&&s)return o.push({op:"unset",path:i}),o;var p=f?u:a;return"object"===p||"array"===p?a!==u?(o.push({op:"set",path:i,value:r}),o):"array"===p?function(t,e,r,n,i){if(e.length>t.length&&i.push({op:"insert",after:n.concat([-1]),items:e.slice(t.length).map((function(t,e){return m(t,n,e,r)}))}),e.length<t.length){var o=t.length-e.length==1,a=t.slice(e.length);!function(t){return Boolean(t.ifRevisionID||t.ifRevisionId)}(r)&&_(a)?i.push.apply(i,a.map((function(t){return{op:"unset",path:n.concat({_key:t._key})}}))):i.push({op:"unset",path:n.concat([o?e.length:[e.length,""]])})}for(var u=0;u<e.length;u++)if(Array.isArray(e[u]))throw new c("Multi-dimensional arrays not supported",n.concat(u),e[u]);var f=Math.min(t.length,e.length),s=t.slice(0,f),p=e.slice(0,f);return _(s)&&_(p)?function(t,e,r,n,i){var o=b(t),a=b(e);if(!function(t,e){return t.length===e.length&&t.every((function(t,r){return e[r]===t}))}(o.keys,a.keys))return v(t,e,r,n,i);for(var u=0;u<a.keys.length;u++){var c=a.keys[u];d(o.index[c],m(a.index[c],n,u,r),r,n.concat({_key:c}),i)}return i}(s,p,r,n,i):v(s,p,r,n,i)}(e,r,n,i,o):function(t,e,r,n,i){for(var o=0===n.length,a=Object.keys(t).filter(o?g:w).map((function(e){return l(e,t[e],n)})),u=a.length,c=Object.keys(e).filter(o?g:w).map((function(t){return l(t,e[t],n)})),f=c.length,s=0;s<u;s++){var p=a[s];p in e||i.push({op:"unset",path:n.concat(p)})}for(var h=0;h<f;h++){var y=c[h];d(t[y],e[y],r,n.concat([y]),i)}return i}(e,r,n,i,o):function(e,r,n,i,o){var a=function(e,r,n,i){var o=n.diffMatchPatch,a=o.lengthThresholdRelative,u=i[i.length-1];if(!(!o.enabled||"string"!=typeof e||"string"!=typeof r||"string"==typeof u&&"_"===u[0]||r.length<o.lengthThresholdAbsolute)){var c="";try{var f=t.makeDiff(e,r),s=t.cleanupEfficiency(f);c=t.stringifyPatches(t.makePatches(s))}catch(t){return}return c.length>r.length*a?void 0:{op:"diffMatchPatch",path:i,value:c}}}(e,r,n,i);return o.push(a||{op:"set",path:i,value:r}),o}(e,r,n,i,o)}function v(t,e,r,n,i){for(var o=0;o<t.length;o++)d(t[o],m(e[o],n,o,r),r,n.concat(o),i);return i}function g(t){return-1===h.indexOf(t)}function _(t){for(var e,r=[],n=0;n<t.length;n++){var i="object"==typeof(e=t[n])&&null!==e&&e._key;if(!i||-1!==r.indexOf(i))return!1;r.push(i)}return!0}function b(t){return t.reduce((function(t,e){return t.keys.push(e._key),t.index[e._key]=e,t}),{keys:[],index:{}})}function m(t,e,r,n){if(void 0!==t)return t;if(!n.hideWarnings){var i=u(e.concat(r));console.warn("undefined value in array converted to null (at '"+i+"')")}return null}function w(t){return!0}exports.DiffError=c,exports.diffItem=d,exports.diffPatch=function(t,r,n){var i=n?function(t){return e({},y,t,{diffMatchPatch:e({},y.diffMatchPatch,t.diffMatchPatch||{})})}(n):y,o=i.id||t._id===r._id&&t._id,a=i.ifRevisionID||i.ifRevisionId,c="boolean"==typeof a?t._rev:a,f=i.basePath||[];if(!o)throw new Error("_id on itemA and itemB not present or differs, specify document id the mutations should be applied to");if(!0===a&&!c)throw new Error("`ifRevisionID` is set to `true`, but no `_rev` was passed in item A. Either explicitly set `ifRevisionID` to a revision, or pass `_rev` as part of item A.");if(0===f.length&&t._type!==r._type)throw new Error("_type is immutable and cannot be changed ("+t._type+" => "+r._type+")");return function(t,r){if(0===t.length)return[];var n=r.id,i=r.ifRevisionID,o=t.filter((function(t){return"set"===t.op})),a=t.filter((function(t){return"unset"===t.op})),c=t.filter((function(t){return"insert"===t.op})),f=t.filter((function(t){return"diffMatchPatch"===t.op})),s=o.length>0&&o.reduce((function(t,e){var r=u(e.path);return t.set[r]=e.value,t}),{id:n,set:{}}),p=a.length>0&&a.reduce((function(t,e){var r=u(e.path);return t.unset.push(r),t}),{id:n,unset:[]}),l=c.reduce((function(t,e){var r=u(e.after);return t.concat({id:n,insert:{after:r,items:e.items}})}),[]);return[s,p,f.length>0&&f.reduce((function(t,e){var r=u(e.path);return t.diffMatchPatch[r]=e.value,t}),{id:n,diffMatchPatch:{}})].concat(l).filter((function(t){return!1!==t})).map((function(t,r){return{patch:i&&0===r?e({},t,{ifRevisionID:i}):t}}))}(d(t,r,i,f,[]),{id:o,ifRevisionID:a?c:void 0})},exports.pathToString=u,exports.validateDocument=function t(e,r){if(void 0===r&&(r=[]),Array.isArray(e))return e.every((function(e,n){if(Array.isArray(e))throw new c("Multi-dimensional arrays not supported",r.concat(n));return t(e,r.concat(n))}));if("object"==typeof e&&null!==e){var n=e;return Object.keys(n).every((function(e){return l(e,n[e],r)&&t(n[e],r.concat(e))}))}return!0}; | ||
//# sourceMappingURL=sanity-diff-patch.cjs.production.min.js.map |
@@ -1,2 +0,2 @@ | ||
import { diff_match_patch } from 'diff-match-patch'; | ||
import { makeDiff, cleanupEfficiency, stringifyPatches, makePatches } from '@sanity/diff-match-patch'; | ||
@@ -24,3 +24,4 @@ function _extends() { | ||
subClass.prototype.constructor = subClass; | ||
subClass.__proto__ = superClass; | ||
_setPrototypeOf(subClass, superClass); | ||
} | ||
@@ -50,3 +51,3 @@ | ||
try { | ||
Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); | ||
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | ||
return true; | ||
@@ -209,3 +210,2 @@ } catch (e) { | ||
var ignoredKeys = ['_id', '_type', '_createdAt', '_updatedAt', '_rev']; | ||
var diff = /*#__PURE__*/new diff_match_patch(); | ||
var defaultOptions = { | ||
@@ -442,5 +442,5 @@ hideWarnings: false, | ||
try { | ||
var patch = diff.diff_main(itemA, itemB); | ||
diff.diff_cleanupEfficiency(patch); | ||
strPatch = diff.patch_toText(diff.patch_make(patch)); | ||
var patch = makeDiff(itemA, itemB); | ||
var diff = cleanupEfficiency(patch); | ||
strPatch = stringifyPatches(makePatches(diff)); | ||
} catch (err) { | ||
@@ -447,0 +447,0 @@ // Fall back to using regular set patch |
{ | ||
"name": "sanity-diff-patch", | ||
"version": "1.0.9", | ||
"version": "2.0.0", | ||
"description": "Generates a set of Sanity patches needed to change an item (usually a document) from one shape to another", | ||
@@ -23,3 +23,3 @@ "main": "dist/index.js", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=14.16" | ||
}, | ||
@@ -31,6 +31,5 @@ "scripts": { | ||
"lint": "tsdx lint", | ||
"prepare": "tsdx build", | ||
"prepublishOnly": "tsdx build", | ||
"coverage": "tsdx test --coverage" | ||
}, | ||
"peerDependencies": {}, | ||
"prettier": { | ||
@@ -42,19 +41,18 @@ "semi": false, | ||
}, | ||
"dependencies": { | ||
"@sanity/diff-match-patch": "^0.0.7" | ||
}, | ||
"devDependencies": { | ||
"@sanity/client": "^1.150.7", | ||
"@types/diff-match-patch": "^1.0.32", | ||
"@types/jest": "^26.0.13", | ||
"eslint-config-prettier": "^6.11.0", | ||
"eslint-config-sanity": "^1.150.1", | ||
"p-queue": "^6.6.1", | ||
"tsdx": "^0.13.3", | ||
"tslib": "^2.0.1", | ||
"typescript": "^4.0.2" | ||
"@sanity/client": "^2.13.0", | ||
"@types/jest": "^26.0.24", | ||
"eslint-config-prettier": "^8.3.0", | ||
"eslint-config-sanity": "^5.1.0", | ||
"p-queue": "^6.0.0", | ||
"tsdx": "^0.14.1", | ||
"tslib": "^2.3.0", | ||
"typescript": "^4.3.5" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node" | ||
}, | ||
"dependencies": { | ||
"diff-match-patch": "^1.0.5" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
import {diff_match_patch as DMP} from 'diff-match-patch' | ||
import {cleanupEfficiency, makeDiff, makePatches, stringifyPatches} from '@sanity/diff-match-patch' | ||
import {DiffError} from './diffError' | ||
@@ -63,4 +63,2 @@ import {Path, pathToString} from './paths' | ||
const diff = new DMP() | ||
const defaultOptions: PatchOptions = { | ||
@@ -320,5 +318,5 @@ hideWarnings: false, | ||
try { | ||
const patch = diff.diff_main(itemA, itemB) | ||
diff.diff_cleanupEfficiency(patch) | ||
strPatch = diff.patch_toText(diff.patch_make(patch)) | ||
const patch = makeDiff(itemA, itemB) | ||
const diff = cleanupEfficiency(patch) | ||
strPatch = stringifyPatches(makePatches(diff)) | ||
} catch (err) { | ||
@@ -325,0 +323,0 @@ // Fall back to using regular set patch |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
8
160659
1681
+ Added@sanity/diff-match-patch@0.0.7(transitive)
- Removeddiff-match-patch@^1.0.5
- Removeddiff-match-patch@1.0.5(transitive)