-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
1.0.0 worked.
In 1.0.3, the API is somehow messed up. The test harness does not detect it.
// that's what it should be but is not:
var a = [[DIFF_EQUAL, 'ab'], [DIFF_INSERT, '123'], [DIFF_EQUAL, 'c']]
var b = dmp.diff_main('abc', 'ab123c', false)
// Instead it's a strange object
console.log(b)
[ { '0': 0, '1': 'ab' },
{ '0': 1, '1': '123' },
{ '0': 0, '1': 'c' } ]
console.log(Array.isArray(a[0])) // true
console.log(Array.isArray(b[0])) // false
console.log(b)
assertEquivalent(a, b); // yes, equivalent
And it breaks ES6 clients:
const [eq, str] = a[0] // works
const [eq, str] = b[0] // breaks
Metadata
Metadata
Assignees
Labels
No labels