The type of object being compared to the target object.
The type of object the source object is being compared to.
Constructs an instance of a Compare object. The only required arguments
are 2 "comparable" non-null objects to compare to each other. As long as
the passed arguments can be interpreted as sets of enumerable properties
(key-value pairs) then they're considered comparable.
The type of object being compared to the target object.
The type of object the source object is being compared to.
The object being compared to the target object.
The object the source object is being compared to.
Returns instantiated
Compare object.
An object containing properties whose keys are present in both the source and target objects, but are mapped to differing values.
Number of properties that are present in both the source and target objects, but are mapped to differing values.
An object containing the keys and their mapped values that are present in the target object but not the source object.
Number of properties the target object contains that aren't present in the source object being compared to it.
Boolean indicating if there are properties in the source and target object mapped to differing values.
Boolean indicating if there are properties in the target object that are not present in the source object.
Boolean indicating if there are properties in the source object that are not present in the target object.
Boolean indicating if there are equivalent properties in the source and target object.
An object containing the keys and their mapped values that are present in the source object but not the target object.
Number of properties the source object contains that aren't present in the target object it's being compared to.
An object containing properties that are present in both the source and target objects being compared that are equivalent. That is, Keys that are present in both the source and target objects that are mapped to equivalent values.
Number of properties that both the source and target object contain that are equivalent.
Contains the source object passed to the constructor during instantiation.
Contains the target object passed to the constructor during instantiation.
Returns a number representing the amount of omitted, extra, shared, and/or altered properties that are present in the source and target objects being compared.
Returns a boolean representing whether omitted, extra, shared, and/or altered properties are present in the source and target objects being compared.
Returns the properties that are present in both the source and target object that have differing values. That is, keys that are present in both the source and target object that are mapped to differing values.
An object containing the keys that are present in the source and target object and the differing values they are mapped to in the source and target object.
Returns the properties that are present in the target object but not the source object that's being compared to it.
An object containing the properties that are not present in the source object but are present in the target object.
Returns the properties that are present in the source object but not the target object it's being compared to.
An object containing the properties that are present in the source object but not the target object.
Returns the properties that are present in both the source and target object that are equivalent. That is, keys that are present in both the source and target object that are also mapped to equivalent values.
An object containing the properties that are present and equivalent in the source and target object.
Returns the source object being compared to the target object. The returned object is frozen to prevent inadvertently mutating it.
The source object being compared to the target object.
Returns the target object that the source object is being compared to. The returned object is frozen to prevent inadvertently mutating it.
The target object the source object is being compared to.
Generated using TypeDoc
The
Compareclass compares 2 objects to each other. It simplifies the process of querying the differences and similarities between the 2 objects being compared. The types of relationships between the objects is relative to how the source object compares to the target object. There are 4 types of relations that can be queried via properties of aCompareobject:omittedProperties
Properties that are present in the source object but not in the target object are considered "omitted" properties. As in they're properties that are present in the source object but omitted in the target object.
extraProperties
Properties that are not present in the source object but are present in the target object are considered "extra" properties. As in they're extra properties that are present in the target object but not in the source object.
sharedProperties
Properties that are present in both the source and target object that are equivalent are considered "shared" properties. If there are keys that are present in both the source and target objects that are also mapped to equivalent values then the key-value pairs are considered shared properties.
alteredProperties
Properties that are present in both the source and target object that contain differing values are considered "altered" properties. If there are keys that are present in both the source and target objects that are mapped to differing values then the key-value pairs are considered altered properties.
Snap