Interface ObjectEqualsOptions

Describe options for the objectEquals function

Hierarchy

  • ObjectEqualsOptions

Properties

ignoreArrayOrder?: boolean

Ignore the order of the elements in an array when comparing arrays for equality.

ignoreExtraElements?: boolean

Ignore extra elements in an array when comparing arrays for equality. For example when array a looks like [1, 2, 3] and array b looks like [1, 2, 3, 4] the arrays are considered equal even though array b has an extra element.

ignoreExtraProperties?: boolean

Ignore extra properties in object b when comparing object a for equality. For example when object b looks like { a: 1, b: 2 } and object a looks like { a: 1 } the objects are considered equal even though object b has an extra property

ignoreMissingProperties?: boolean

Ignore missing properties in object b when comparing object a for equality. For example when object a looks like { a: 1, b: 2 } and object b looks like { a: 1 } the objects are considered equal even though object b is missing the b property.

objectCompare?: ((a, b) => boolean)

Type declaration

    • (a, b): boolean
    • Function to compare 2 objects for equality, defaults to objectEquals-comparison; the function should return true if the 2 objects are equal otherwise false. If the function is not specified the objectEquals-function is used to compare the objects;

      Parameters

      • a: object
      • b: object

      Returns boolean

primitiveCompare?: ((a, b) => boolean)

Type declaration

    • (a, b): boolean
    • Function to compare 2 primitives for equality, defaults to ===-comparison; the function should return true if the 2 primitives are equal otherwise false.

      Parameters

      • a: unknown
      • b: unknown

      Returns boolean