export function deepEqual()

in authui-container/common/deep-copy.ts [35:56]


export function deepEqual(a: any, b: any): boolean {
  if (a === b) {
    return true;
  } else if (typeof a === 'object' &&
             typeof b === 'object' &&
             a !== null &&
             b !== null &&
             Object.keys(a).length === Object.keys(b).length) {
    // Match properties one by one.
    for (const prop in a) {
      if (a.hasOwnProperty(prop)) {
        if (!b.hasOwnProperty(prop) ||
            !deepEqual(a[prop], b[prop])) {
          return false;
        }
      }
    }
    // All sub properties match.
    return true;
  }
  return false;
}