Comments (3)
Yea, the change happened here https://github.com/JackuB/diff-match-patch/pull/13/files#diff-168726dbe96b3ce427e7fedce31bb0bcR76
It's emulating array for backward compatibility. But the destructing use case is not taken care of.
- We could add Symbol.iterator to the
Diff
object (this would require some kind of transpilation) - Publish this as breaking and go for v2 (and release 1.0.4 without this change)
- Patch it to use array (current tests are passing)
diff_match_patch.Diff = function(op, text) {
return [op, text];
};
Wondering if there is any reason they did that - most likely to keep the API 1:1 with rest of the implementations. Will try to look into it a bit more.
from diff-match-patch.
I was going to submit an issue in google but saw yours , thanks.
If google is happy with status quo, I'd propose option 2 as the one that can break in least possible ways, although it's a bit a strange api. Lets see what they say..
from diff-match-patch.
Released 1.0.4 with a rollback https://github.com/JackuB/diff-match-patch/releases/tag/1.0.4
Will hold on with releasing v2 as there is a chance they will rollback the API change
from diff-match-patch.
Related Issues (13)
- Wrong license on npm HOT 2
- Update to newest Google version HOT 1
- Can't instantiate DiffMatchPatch HOT 2
- Files with more than 65535 lines produce incorrect diffs HOT 1
- How to compare multi-line diff
- Library throws "URI malformed" error when creating patch with emojis HOT 9
- Boilerplate in License HOT 1
- Uncaught ReferenceError: module is not defined HOT 2
- Possible diff miss-match between JavaScript and C++ HOT 2
- Documentation/Examples HOT 2
- The link to the API doesn't exist anymore HOT 2
- patch_toText, unified diff like output
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diff-match-patch.