Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "object/compare"

Index

Functions

compare

  • compare<T>(left: T, right: T): number
  • Compares two object of the same type and returns an integer that indicates whether the left object precedes, follows, or occurs in the same position in the sort order as the right object. Comparison is done on the native object, without any locale support,

    Type parameters

    • T

    Parameters

    • left: T
    • right: T

    Returns number

isContentEqual

  • isContentEqual(left: any, right: any): boolean
  • A function that determines if two objects have the same content.

    Parameters

    • left: any

      The left object to compare

    • right: any

      The right object to compare

    Returns boolean

    true if both objects are equal.

isEqual

  • isEqual(left: any, right: any): boolean
  • A function that determines if two objects are equal. Used as a shortcut to the == operator when a comparer method is needed.

    Parameters

    • left: any

      The left object to compare

    • right: any

      The right object to compare

    Returns boolean

    true if both objects are equal.

isSequenceEqual

  • isSequenceEqual<T>(left: any[], right: any[], comparer?: (a: any, b: any) => boolean): boolean
  • A function that determines if two sequences contain the same values.

    Type parameters

    • T

    Parameters

    • left: any[]

      The left array to compare

    • right: any[]

      The right array to compare

    • Default value comparer: (a: any, b: any) => boolean = isContentEqual

      The comparer used to compare the individual items of the array. Default comparer is isContentEqual

        • (a: any, b: any): boolean
        • Parameters

          • a: any
          • b: any

          Returns boolean

    Returns boolean

    true if both sequences are equal.

isStrictEqual

  • isStrictEqual(left: any, right: any): boolean
  • A function that determines if two objects are equal. Used as a shortcut to the === operator when a comparer method is needed.

    Parameters

    • left: any

      The left object to compare

    • right: any

      The right object to compare

    Returns boolean

    true if both objects are equal.

Generated using TypeDoc