-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Port diff_match_patch into Typescript #74
base: master
Are you sure you want to change the base?
Conversation
How well do the types line up with |
They are mostly a match with the exception of Diff. I decided to match other language conversions here and make Diff a class. It’s neater that way and allows us to call the fields operation and text rather than use them by their indices. What are your thoughts Kyle? |
I'm not going to be migrating from the |
I'm more worried about the breaking change to the JavaScript than the TypeScript. Having real guaranteed correct types (because the compiler generates the .d.ts) is worth the migration pain. |
Type definition in @types is just a mirror. I agree with the library itself has one and it's officially preferred. |
One thing we can do to help ease migration is support both types. Here's a quick prototype of my suggestion. tl;dr.
--- Edit I think it makes more sense to just provide helpers for anyone coming from the JS world. |
…tory method to create Diff from array
Hey. Wasn't this issue closed, or unmerged yet? |
Still unmerged. Things move slow here. You can tell because it says "Open" and not "Closed" or "Merged" 😉 It'd be nice if this were easier to review, but if it's up-to-date and all the tests pass it could be worth merging for no other reason than to keep it moving. Things I know I would like to see with this:
|
Ported the Javascript version of diff_match_patch into Typescript.
To run tests: