function keysWithoutUndefinedValues(obj) {
    return Object.keys(obj).filter((key)=>void 0 !== obj[key]);
}
function deepEqual(obj1, obj2, nested = 0, parentKey = 'top >') {
    if (obj1 === obj2) return true;
    if (isPrimitive(obj1) && isPrimitive(obj2)) return obj1 === obj2;
    const keys1 = keysWithoutUndefinedValues(obj1);
    const keys2 = keysWithoutUndefinedValues(obj2);
    if (keys1.length !== keys2.length) return false;
    for(const key in obj1){
        if (!(key in obj2) && void 0 !== obj1[key]) return false;
        if (key in obj2 && !deepEqual(obj1[key], obj2[key], nested + 1, `${parentKey} ${key}`)) return false;
    }
    return true;
}
function isPrimitive(obj) {
    return obj !== Object(obj);
}
export { deepEqual };
