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
Javascript: Add iterable instance to Diff for destructuring.
Resolvesgoogle#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]>
0 commit comments