Options
All
  • Public
  • Public/Protected
  • All
Menu

LINQify Documentation

Index

Type aliases

IComparer

IComparer<T>: (x: T, y: T) => number

Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other.

Type parameters

  • T

Type declaration

    • (x: T, y: T): number
    • Parameters

      • x: T
      • y: T

      Returns number

IEqualityComparer

IEqualityComparer<T>: { Equals: (x: T, y: T) => boolean; GetHashCode: (obj: T) => any }

Defines type to support the comparison of objects for equality.

Type parameters

  • T

Type declaration

  • Equals: (x: T, y: T) => boolean
      • (x: T, y: T): boolean
      • Parameters

        • x: T
        • y: T

        Returns boolean

  • GetHashCode: (obj: T) => any
      • (obj: T): any
      • Parameters

        • obj: T

        Returns any

KeyValuePair

KeyValuePair<TKey, TValue>: { Key: TKey; Value: TValue }

Defines type for key/value pair object.

Type parameters

  • TKey

  • TValue

Type declaration

  • Key: TKey
  • Value: TValue

Variables

Const EqualityComparers

EqualityComparers: { DeepComparer: <T>(selector?: (item: T) => any) => IEqualityComparer<T>; PrimitiveComparer: IEqualityComparer<any> }

Implements Deep equality comparer for deep value comparison of objects and Primitive equality comparer for value or reference comparison.

Type declaration

  • DeepComparer: <T>(selector?: (item: T) => any) => IEqualityComparer<T>

    Recursively compare objects by attributes.

    let people = [{Name:"John", Age:15},{Name:"John", Age:15},{Name:"John", Age:13}]
    people.Distinct().ToArray()
    // [{"Name":"John","Age":15},{"Name":"John","Age":15},{"Name":"John","Age":13}]
    people.Distinct(EqualityComparers.DeepComparer()).ToArray()
    // [{"Name":"John","Age":15},{"Name":"John","Age":13}]
    people.Distinct(EqualityComparers.DeepComparer(t=>({Name:t.Name}))).ToArray()
    // [{"Name":"John","Age":15}]
    people.Distinct(EqualityComparers.DeepComparer(t=>t.Name)).ToArray()
    // [{"Name":"John","Age":15}]
    
      • Type parameters

        • T

        Parameters

        • Optional selector: (item: T) => any
            • (item: T): any
            • Parameters

              • item: T

              Returns any

        Returns IEqualityComparer<T>

  • PrimitiveComparer: IEqualityComparer<any>

Const SortComparers

SortComparers: { DefaultComparer: IComparer<any>; DefaultComparerReverse: IComparer<any> }

Implements default basic and reverse comparer.

Type declaration

Const linqify

linqify: { Dictionary: typeof Dictionary; Enumerable: typeof Enumerable; EqualityComparers: typeof EqualityComparers; HashSet: typeof HashSet; List: typeof List; SortComparers: typeof SortComparers; noConflict: () => { Dictionary: typeof Dictionary; Enumerable: typeof Enumerable; EqualityComparers: typeof EqualityComparers; HashSet: typeof HashSet; List: typeof List; SortComparers: typeof SortComparers } }

Type declaration

Generated using TypeDoc