isObjectEqual()function
isObjectEqual(left: ImmutableObject, right: T, recursor: Match = isEqual): left is T
| Param | Type | |
|---|---|---|
left | ImmutableObject | The object to check and narrow. required |
right | T | The object to compare against. required |
recursor | Match | 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?
leftmust have every property present inrightleftmust not have excess properties not present inright
Examples
isObjectEqual({ a: 1 }, { a: 1 }) // true