{"size": 1020, "ext": "js", "max_stars_repo_path": "src/task-6.js", "max_stars_repo_name": "MiroslavDerevianko/practice-2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/task-6.js", "max_issues_repo_name": "MiroslavDerevianko/practice-2", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/task-6.js", "max_forks_repo_name": "MiroslavDerevianko/practice-2", "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": 19.6153846154, "max_line_length": 53, "alphanum_fraction": 0.4401960784}

export default function findPath(obj) {
    for (const [key, value] of Object.entries(obj)) {
        if (typeof value === "object") {
            const path = findPath(value); 
            if (path) {
                return `${key}.${path}`;
            }
            continue;
        }

        if (value === 15) {
            return key;
        }
    }
    return null;
}

/*export default function findPath(obj) {
    // Change me!
 
    let result = [];
    let link = "";

    rec(obj, link, "", result);
    if(result.length === 0) {
        return null;
    } else {
        return result[0];
    }
    return rec(obj);
}*/

/*function rec(obj, link, l, result ) {
    if (obj === 15) {
       link += l;
       link = link.slice(0, -1);
       result.push(link);
       return link;
    } else if (typeof obj === "object") {
        link += l;
        for (const item in obj) {
            l = `${item}.`;
            rec(obj[item], link, l, result);
        }
    }
}*/

/*function rec(value) {
    
   
}*/