geoview-core
    Preparing search index...

    Function shallowObjectEqual

    • Performs a shallow equality check between two objects. Compares the objects' own enumerable keys and values using Object.is. Returns true if both objects have the same keys and corresponding values, false otherwise. Note: This is a shallow comparison. Nested objects or arrays are compared by reference.

      Type Parameters

      • T

      Parameters

      • a: T

        The first object to compare.

      • b: T

        The second object to compare.

      Returns boolean

      True if the objects are shallowly equal, false otherwise.

      const obj1 = { foo: 1, bar: 2 };
      const obj2 = { foo: 1, bar: 2 };
      const obj3 = { foo: 1, bar: 3 };
      shallowObjectEqual(obj1, obj2); // true
      shallowObjectEqual(obj1, obj3); // false