UNPKG

imma

Version:

A collection of functions for dealing with native arrays and objects immutably

12 lines (11 loc) 311 B
'use strict' const equalsWith = module.exports = (a, b, fn) => { const aKeys = Object.keys(a) const bKeys = Object.keys(b) if (aKeys.length !== bKeys.length) return false for (let key of aKeys) { if (!(key in b)) return false if (!fn(a[key], b[key])) return false } return true }