Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Javascript: Add iterable instance to Diff for destructuring.
Resolves google#39 It can be useful to extract `Diff` elements using destructuring assignment. For example: ```js const a = dmp.diff_main('abc', 'ab123c', false); const [eq, str] = a[0]; ``` Because the `Diff` object is not an array, however, this is not possible, even though it acts like an array. In this patch a new `Symbol.iterator` method is added to the `Diff` class so that this pattern can be used. Props: @JackuB, @GrosSacASac, @TheSpyder Co-authored-by: Cyril Walle <[email protected]>
- Loading branch information