export const haveSameStructure = (object1, object2) => {
    const keys1 = Object.keys(object1);
    const keys2 = Object.keys(object2);
    // Different key count
    if (keys1.length !== keys2.length) {
        return false;
    }
    // Check if all keys from object1 are in object2
    for (const key of keys1) {
        if (!object2.hasOwnProperty(key)) {
            return false;
        }
        // If the value is an object, call haveSameStructure
        if (typeof object1[key] === "object" && object1[key] !== null) {
            if (typeof object2[key] !== "object" || object2[key] === null) {
                return false;
            }
            if (!haveSameStructure(object1[key], object2[key])) {
                return false;
            }
        }
        // If the value is not an object, ensure that the key in object2 is not an object
        else if (typeof object2[key] === "object" && object2[key] !== null) {
            return false;
        }
    }
    return true;
};
//# sourceMappingURL=same-structure.e2e.js.map
