Function safeEqual
- safeEqual(
source: object,
target: object,
options?: { arrayIndex?: boolean; hasOwnOnly?: boolean },
): boolean Parameters
- source: object
Source object.
- target: object
Target object.
Optional
options: { arrayIndex?: boolean; hasOwnOnly?: boolean }Options.
Optional
arrayIndex?: booleanSet to
false
to exclude equality testing for array contents; default:true
.Optional
hasOwnOnly?: booleanSet to
false
to include enumerable prototype properties; default:true
.
Returns boolean
True if equal.
- source: object
Compares a source object and values of entries against a target object. If the entries in the source object match the target object then
true
is returned otherwisefalse
. If either object is undefined or null then false is returned.Note: The source and target should be JSON objects.