{"size": 793, "ext": "js", "max_stars_repo_path": "resources/js/constants/index.js", "max_stars_repo_name": "Evenhuis81/art-revo", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/constants/index.js", "max_issues_repo_name": "Evenhuis81/art-revo", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/js/constants/index.js", "max_forks_repo_name": "Evenhuis81/art-revo", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.3214285714, "max_line_length": 80, "alphanum_fraction": 0.5220680958}
export const makeTree = (nodes, parentId = 0) => {
    const out = []
    nodes.forEach(node => {
        if(node.parent_id === parentId) {
            const children = makeTree(nodes, node.id)
            if(children.length) {
                node.children = children
            }
            out.push(node)
        }
    })
    return out
}

export const uuidv4 = () => {
    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        let r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
        return v.toString(16);
    });
}

export const camelCase = ((data, delim = '-') => {
    const list = Array.isArray(data) ? data : data.split(delim)
    return list.reduce((res, cur) => res + cur.charAt(0)
        .toUpperCase() + cur.slice(1)
    )
})
