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