equal.js 375 Bytes
Newer Older
nikogu's avatar
nikogu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* eslint eqeqeq: 0 */

function equal(old, target) {
  let r = true;
  for (const prop in old) {
    if (typeof old[prop] === 'function' && typeof target[prop] === 'function') {
      if (old[prop].toString() != target[prop].toString()) {
        r = false;
      }
    } else if (old[prop] != target[prop]) {
      r = false;
    }
  }
  return r;
}

export default equal;