You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While you can create a unified diff with createPatch and then apply that to another string using applyPatch, there doesn't seem to be a way to apply Change Objects.
I think this would be helpful to apply diffs to data where line-context is not sufficient to match the diff.
e.g., something like:
conststr1='Greetings,\nhello world'conststr2='Greetings\nhello my friend'constdiffs=diffWords(str1,str2)constresult=applyDiffs('hello world',diffs)expect(result).to.equal('hello my friend')
The text was updated successfully, but these errors were encountered:
While you can create a unified diff with
createPatch
and then apply that to another string usingapplyPatch
, there doesn't seem to be a way to apply Change Objects.I think this would be helpful to apply diffs to data where line-context is not sufficient to match the diff.
e.g., something like:
The text was updated successfully, but these errors were encountered: