package.src.deepEqual.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react-hotkeys-hook Show documentation
Show all versions of react-hotkeys-hook Show documentation
React hook for handling keyboard shortcuts
The newest version!
export default function deepEqual(x: any, y: any): boolean {
//@ts-ignore
return x && y && typeof x === 'object' && typeof y === 'object'
? Object.keys(x).length === Object.keys(y).length &&
//@ts-ignore
Object.keys(x).reduce((isEqual, key) => isEqual && deepEqual(x[key], y[key]), true)
: x === y
}