Class: Equal
Utility class for comparing equality of m2c2kit objects.
Constructors
new Equal()
new Equal():
Equal
Returns
Methods
objectsDeepEqual()
static
private
objectsDeepEqual(obj1
,obj2
):boolean
Compares two objects for deep equality.
Parameters
• obj1: ValueType
object to compare
• obj2: ValueType
object to compare
Returns
boolean
true if objects have deep equality
Remarks
In JavaScript, arrays are objects, so this method will also compare arrays for deep equality.
Source
rgbaColor()
static
rgbaColor(color1
?,color2
?):boolean
Compares two RgbaColor objects and returns true if they are equal.
Parameters
• color1?: RgbaColor
• color2?: RgbaColor
Returns
boolean
Remarks
If either of the colors is undefined, the comparison will return false. RgbaColor is an array of 4 numbers, and thus is a reference type. We need this method to compare two RgbaColor objects for value equality.
Source
value()
static
value(value1
,value2
):boolean
Compares two values for deep equality.
Parameters
• value1: ValueType
value to compare
• value2: ValueType
value to compare
Returns
boolean
true if values have deep equality
Remarks
Supported values are string, number, boolean, null, undefined, and object (note that arrays are objects in JavaScript).