Skip to content

Instantly share code, notes, and snippets.

@xettri
Created June 12, 2022 14:15
Show Gist options
  • Save xettri/78ddcfed122dee960720466f61b43451 to your computer and use it in GitHub Desktop.
Save xettri/78ddcfed122dee960720466f61b43451 to your computer and use it in GitHub Desktop.
const { deepEqual } = require('assert');
Object.defineProperty(Object.prototype, 'deepEqual', {
writable: false,
enumerable: false,
configurable: false,
value: (a, b) => deepEqual(a, b),
})
// Usage:
Object.deepEqual({ a: 1 }, { a: 1 }); // true
Object.deepEqual({ a: 1 }, { a: 2 }); // false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment