isObjectEqual()function

isObjectEqual(left: ImmutableObject, right: T, recursor: Match = isEqual): left is T
ParamType
leftImmutableObject
The object to check and narrow. required
rightT
The object to compare against. required
recursorMatch
Function that checks each prop of the object.
- Defaults to isEqual() to check strict equality of the properties.
- Use isDeepEqual() as the recursor to check to check deep equality of the properties. Defaults to isEqual
Return
left is T
true if both objects have exactly the same own props and matching values.

Are two objects equal based on their own props?

  • left must have every property present in right
  • left must not have excess properties not present in right

Examples

isObjectEqual({ a: 1 }, { a: 1 }) // true