{"size": 941, "ext": "js", "max_stars_repo_path": "index.js", "max_stars_repo_name": "conradz/flatten-list", "max_stars_repo_stars_event_min_datetime": "2016-08-01T08:41:50.000Z", "max_stars_repo_stars_event_max_datetime": "2016-08-01T08:41:50.000Z", "max_issues_repo_path": "index.js", "max_issues_repo_name": "conradz/flatten-list", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "index.js", "max_forks_repo_name": "conradz/flatten-list", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 22.4047619048, "max_line_length": 51, "alphanum_fraction": 0.4803400638}
var isList;
if (typeof window !== 'undefined') {
    // Running in a browser
    isList = (function(window, Node) {
        return function(value) {
            return (
                value &&
                typeof value === 'object' &&
                typeof value.length === 'number' &&
                !(value instanceof Node) &&
                value !== window);
        }
    })(window, window.Node);
} else {
    // Running in non-browser environment
    isList = function(value) {
        return (
            value &&
            typeof value === 'object' &&
            typeof value.length === 'number');
    };
}


function add(array, value) {
    if (isList(value)) {
        for (var i = 0; i < value.length; i++) {
            add(array, value[i]);
        }
    } else {
        array.push(value);
    }
}

function flatten(value) {
    var items = [];
    add(items, value);
    return items;
}

module.exports = flatten;
