function equals (objA, objB, deep = false) {
  if (objA === objB) {
    return true
  }
  if (!objA || !objB) {
    return false
  }
  if (typeof objA !== 'object' && typeof objB !== 'object') {
    // Compare scalar values
    return objA === objB
  }
  const aKeys = Object.keys(objA)
  const bKeys = Object.keys(objB)
  const len = aKeys.length

  if (bKeys.length !== len) {
    return false
  }

  for (let i = 0; i < len; i++) {
    const key = aKeys[i]
    if ((!deep && objA[key] !== objB[key]) || (deep && !equals(objA[key], objB[key], deep))) {
      return false
    }
  }
  return true
}
Shallow equal.
@param {} objA
@param {*} objB