function deepEqual(a, b) {
    if (a === b) return true;
    if (null == a || null == b) return false;
    const typeA = typeof a;
    const typeB = typeof b;
    if (typeA !== typeB) return false;
    if (Array.isArray(a)) {
        if (!Array.isArray(b) || a.length !== b.length) return false;
        for(let i = 0; i < a.length; i++)if (!deepEqual(a[i], b[i])) return false;
        return true;
    }
    if ('object' === typeA) {
        const aObj = a;
        const bObj = b;
        const aKeys = Object.keys(aObj);
        const bKeys = Object.keys(bObj);
        if (aKeys.length !== bKeys.length) return false;
        for(let i = 0; i < aKeys.length; i++){
            const key = aKeys[i];
            if (!deepEqual(aObj[key], bObj[key])) return false;
        }
        return true;
    }
    return false;
}
export { deepEqual };
