const assert = require('assert')
const homogenize = require('./homogenize')

module.exports = function (comparator, collections) {
    return homogenize(comparator, collections, 1, (iterators, consume) => {
        const got = []
        do {
            const set = iterators.map(iterator => iterator.inner[iterator.index++])
            assert(set.slice(1).every((entry, index) => comparator(set[index].key, set[index + 1].key) == 0))
            const items = []
            got.push({
                key: set[0].key,
                value: set[0].value,
                items: items.concat.apply(items, set.map(entry => entry.items))
                            .sort((left, right) => comparator(left.key, right.key))
            })
        } while (iterators.every(iterator => iterator.inner.length != iterator.index))
        consume(got)
    })
}

@@ -324,118 +324,8 @@
 +%5D)%0A
-            assert(set.slice(1).every((entry, index) =%3E comparator(set%5Bindex%5D.key, set%5Bindex + 1%5D.key) == 0))%0A
     

Remove outer key assertion from map.