src/safe_merge.js
function doesObjectListHaveDuplicates(l) {
    const mergedList = l.reduce((merged, obj) => (
        obj ? merged.concat(Object.keys(obj)) : merged
    ), []);

    // Taken from: http://stackoverflow.com/a/7376645/1263876
    // By casting the array to a Set, and then checking if the size of the array
    // shrunk in the process of casting, we can check if there were any duplicates
    return new Set(mergedList).size !== mergedList.length;
}
function doesObjectListHaveDuplicates(l) {
    const mergedList = l.reduce((merged, obj) => (
        obj ? merged.concat(Object.keys(obj)) : merged
    ), []);

    // Taken from: http://stackoverflow.com/a/7376645/1263876
    // By casting the array to a Set, and then checking if the size of the array
    // shrunk in the process of casting, we can check if there were any duplicates
    return new Set(mergedList).size !== mergedList.length;
}
function doesObjectListHaveDuplicates ( l ) { const mergedList = l . reduce ( ( merged , obj ) => ( obj ? merged . concat ( Object . keys ( obj ) ) : merged ) , [ ] ) ; // Taken from: http://stackoverflow.com/a/7376645/1263876 // By casting the array to a Set, and then checking if the size of the array // shrunk in the process of casting, we can check if there were any duplicates return new Set ( mergedList ) . size !== mergedList . length ; }
Checks a list of objects for key duplicates and returns a boolean
Checks a list of objects for key duplicates and returns a boolean