lib/registrations.js
function flatten(arr) {
    return arr.reduce(function (flat, toFlatten) {
        // See if this index is an array that itself needs to be flattened.
        if(toFlatten.some && toFlatten.some(Array.isArray)) {
            return flat.concat(flatten(toFlatten));
            // Otherwise just add the current index to the end of the flattened array.
        } else {
            return flat.concat(toFlatten);
        }
    }, []);
}
function flatten(arr) {
    return arr.reduce(function (flat, toFlatten) {
        // See if this index is an array that itself needs to be flattened.
        if(toFlatten.some && toFlatten.some(Array.isArray)) {
            return flat.concat(flatten(toFlatten));
            // Otherwise just add the current index to the end of the flattened array.
        } else {
            return flat.concat(toFlatten);
        }
    }, []);
}
function flatten ( arr ) { return arr . reduce ( function ( flat , toFlatten ) { // See if this index is an array that itself needs to be flattened. if ( toFlatten . some && toFlatten . some ( Array . isArray ) ) { return flat . concat ( flatten ( toFlatten ) ) ; // Otherwise just add the current index to the end of the flattened array. } else { return flat . concat ( toFlatten ) ; } } , [ ] ) ; }
flattens array of arrays of arrays...
flattens array of arrays of arrays ...