JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr{ gilour

File "shallow-equal-20260314155335.ts"

Full Path: /home/markqprx/iniasli.pro/client/utils/shallow-equal-20260314155335.ts
File size: 574 bytes
MIME-type: text/plain
Charset: utf-8

export function shallowEqual<
  T extends Record<string, unknown> = Record<string, unknown>
>(objA?: T, objB?: T) {
  if (objA === objB) {
    return true;
  }

  if (!objA || !objB) {
    return false;
  }

  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 (
      objA[key] !== objB[key] ||
      !Object.prototype.hasOwnProperty.call(objB, key)
    ) {
      return false;
    }
  }

  return true;
}