Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "iterable-query/fn"

Index

Namespaces

Interfaces

Functions (Query)

Functions (Scalar)

Functions (Subquery)

Functions (Order)

Functions (Join)

Functions (Hierarchy)

Functions

Functions (Query)

choose

  • Creates an [[Iterable]] that iterates the elements from sources picked from a list based on the result of a lazily evaluated choice.

    category

    Query

    Type parameters

    • K
    • V

    Parameters

    • chooser: function

      A callback used to choose a source.

        • (): K
        • Returns K

    • choices: Queryable<Choice<K, V>>

      A Queryable of key/value pairs, where each value is a Queryable object.

    • Optional otherwise: Queryable<V>

      A default source to use when another choice could not be made.

    Returns Iterable<V>

chooseAsync

  • Creates an [[Iterable]] that iterates the elements from sources picked from a list based on the result of a lazily evaluated choice.

    category

    Query

    Type parameters

    • K
    • V

    Parameters

    • chooser: function

      A callback used to choose a source.

        • (): PromiseLike<K> | K
        • Returns PromiseLike<K> | K

    • choices: AsyncQueryable<AsyncChoice<K, V>>

      An AsyncQueryable of key/value pairs, where each value is an AsyncQueryable object.

    • Optional otherwise: AsyncQueryable<V>

      A default source to use when another choice could not be made.

    Returns AsyncIterable<V>

conditional

  • Creates an [[Iterable]] that iterates the elements from one of two sources based on the result of a lazily evaluated condition.

    category

    Query

    Type parameters

    • T

    Parameters

    • condition: function

      A callback used to choose a source.

        • (): boolean
        • Returns boolean

    • thenQueryable: Queryable<T>

      The source to use when the callback evaluates to true.

    • Optional elseQueryable: Queryable<T>

      The source to use when the callback evaluates to false.

    Returns Iterable<T>

consume

  • Creates an [[Iterable]] that, when iterated, consumes the provided [[Iterator]].

    category

    Query

    Type parameters

    • T

    Parameters

    Returns Iterable<T>

consumeAsync

  • Creates an [[AsyncIterable]] that, when iterated, consumes the provided [[AsyncIterator]].

    category

    Query

    Type parameters

    • T

    Parameters

    • iterator: AsyncIterator<T>

      An [[AsyncIterator]] object.

    • Default value __namedParameters: object = {}

    Returns AsyncIterable<T>

continuous

  • Creates an [[Iterable]] that repeats the provided value forever.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: T

      The value for each element of the [[Iterable]].

    Returns Iterable<T>

continuousAsync

  • continuousAsync<T>(value: PromiseLike<T> | T): AsyncIterable<T>
  • Creates an [[AsyncIterable]] that repeats the provided value forever.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: PromiseLike<T> | T

      The value for each element of the [[AsyncIterable]].

    Returns AsyncIterable<T>

empty

  • Creates an [[Iterable]] with no elements.

    category

    Query

    Type parameters

    • T

    Returns Iterable<T>

emptyAsync

generate

  • generate<T>(count: number, generator: function): Iterable<T>
  • Creates an [[Iterable]] whose values are provided by a callback executed a provided number of times.

    category

    Query

    Type parameters

    • T

    Parameters

    • count: number

      The number of times to execute the callback.

    • generator: function

      The callback to execute.

        • (offset: number): T
        • Parameters

          • offset: number

          Returns T

    Returns Iterable<T>

generateAsync

  • generateAsync<T>(count: number, generator: function): AsyncIterable<T>
  • Creates an [[AsyncIterable]] whose values are provided by a callback executed a provided number of times.

    category

    Query

    Type parameters

    • T

    Parameters

    • count: number

      The number of times to execute the callback.

    • generator: function

      The callback to execute.

        • (offset: number): PromiseLike<T> | T
        • Parameters

          • offset: number

          Returns PromiseLike<T> | T

    Returns AsyncIterable<T>

ifAsync

  • Creates an [[AsyncIterable]] that iterates the elements from one of two sources based on the result of a lazily evaluated condition.

    category

    Query

    Type parameters

    • T

    Parameters

    • condition: function

      A callback used to choose a source.

        • (): PromiseLike<boolean> | boolean
        • Returns PromiseLike<boolean> | boolean

    • thenQueryable: AsyncQueryable<T>

      The source to use when the callback evaluates to true.

    • Optional elseQueryable: AsyncQueryable<T>

      The source to use when the callback evaluates to false.

    Returns AsyncIterable<T>

objectEntries

  • Creates an [[Iterable]] for the own property entries of an object.

    category

    Query

    Type parameters

    • T: object

    Parameters

    • source: T

      An object.

    Returns Iterable<KeyValuePair<T, Extract<keyof T, string>>>

objectEntriesAsync

  • Creates an [[AsyncIterable]] for the own property entries of an object.

    category

    Query

    Type parameters

    • T: object

    Parameters

    • source: PromiseLike<T> | T

      An object or a [[Promise]] for an object.

    Returns AsyncIterable<KeyValuePair<T, Extract<keyof T, string>>>

objectKeys

  • objectKeys<T>(source: T): Iterable<Extract<keyof T, string>>
  • Creates an [[Iterable]] for the own property keys of an object.

    category

    Query

    Type parameters

    • T: object

    Parameters

    • source: T

      An object.

    Returns Iterable<Extract<keyof T, string>>

objectKeysAsync

  • objectKeysAsync<T>(source: PromiseLike<T> | T): AsyncIterable<Extract<keyof T, string>>
  • Creates an [[AsyncIterable]] for the own property keys of an object.

    category

    Query

    Type parameters

    • T: object

    Parameters

    • source: PromiseLike<T> | T

      An object or a [[Promise]] for an object.

    Returns AsyncIterable<Extract<keyof T, string>>

objectValues

  • objectValues<T>(source: T): Iterable<T[Extract<keyof T, string>]>
  • Creates an [[Iterable]] for the own property values of an object.

    category

    Query

    Type parameters

    • T: object

    Parameters

    • source: T

      An object.

    Returns Iterable<T[Extract<keyof T, string>]>

objectValuesAsync

  • objectValuesAsync<T>(source: PromiseLike<T> | T): AsyncIterable<T[Extract<keyof T, string>]>
  • Creates an [[AsyncIterable]] for the own property values of an object.

    category

    Query

    Type parameters

    • T: object

    Parameters

    • source: PromiseLike<T> | T

      An object or a [[Promise]] for an object.

    Returns AsyncIterable<T[Extract<keyof T, string>]>

once

  • Creates an [[Iterable]] over a single element.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: T

      The only element for the [[Iterable]].

    Returns Iterable<T>

onceAsync

  • Creates an [[AsyncIterable]] over a single element.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: PromiseLike<T> | T

      The only element for the [[AsyncIterable]].

    Returns AsyncIterable<T>

range

  • range(start: number, end: number, increment?: number): Iterable<number>
  • Creates an [[Iterable]] over a range of numbers.

    category

    Query

    Parameters

    • start: number

      The starting number of the range.

    • end: number

      The ending number of the range.

    • Default value increment: number = 1

      The amount by which to change between each itereated value.

    Returns Iterable<number>

repeat

  • repeat<T>(value: T, count: number): Iterable<T>
  • Creates an Iterable for a value repeated a provided number of times.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: T

      The value for each element of the Iterable.

    • count: number

      The number of times to repeat the value.

    Returns Iterable<T>

repeatAsync

  • repeatAsync<T>(value: PromiseLike<T> | T, count: number): AsyncIterable<T>
  • Creates an Iterable for a value repeated a provided number of times.

    category

    Query

    Type parameters

    • T

    Parameters

    • value: PromiseLike<T> | T

      The value for each element of the Iterable.

    • count: number

      The number of times to repeat the value.

    Returns AsyncIterable<T>

Functions (Scalar)

average

  • average(source: Queryable<number>): number
  • average<T>(source: Queryable<T>, elementSelector: function): number
  • Computes the average for a series of numbers.

    category

    Scalar

    Parameters

    Returns number

  • Computes the average for a series of numbers.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • elementSelector: function

      A callback used to convert a value in source to a number.

        • (element: T): number
        • Parameters

          • element: T

          Returns number

    Returns number

averageAsync

  • Computes the average for a series of numbers. NOTE: If any element is not a number, this overload will throw.

    category

    Scalar

    Parameters

    Returns Promise<number>

  • Computes the average for a series of numbers.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • elementSelector: function

      A callback used to convert a value in source to a number.

        • (element: T): number | PromiseLike<number>
        • Parameters

          • element: T

          Returns number | PromiseLike<number>

    Returns Promise<number>

breakAsync

copyTo

  • copyTo<T, U>(source: Queryable<T>, dest: U, start?: number, count?: number): U
  • Writes each element of a source iterable to a destination array.

    category

    Scalar

    Type parameters

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • dest: U

      The destination array.

    • Default value start: number = 0

      The offset into the array at which to start writing.

    • Default value count: number = dest.length - start

      The number of elements to write to the array.

    Returns U

copyToAsync

  • Writes each element of a source iterable to a destination array.

    category

    Scalar

    Type parameters

    Parameters

    • source: AsyncQueryable<T>

      A Queryable object.

    • dest: U

      The destination array.

    • Default value start: number = 0

      The offset into the array at which to start writing.

    • Default value count: number = dest.length - start

      The number of elements to write to the array.

    Returns Promise<U>

corresponds

  • corresponds<T>(left: Queryable<T>, right: Queryable<T>, equaler?: EqualityComparison<T> | Equaler<T>): boolean
  • corresponds<T, U>(left: Queryable<T>, right: Queryable<U>, equaler: function): boolean
  • Computes a scalar value indicating whether every element in left corresponds to a matching element in right at the same position.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      An optional callback used to compare the equality of two elements.

    Returns boolean

  • Computes a scalar value indicating whether every element in left corresponds to a matching element in right at the same position.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<U>

      A Queryable object.

    • equaler: function

      An optional callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns boolean

correspondsAsync

  • Computes a scalar value indicating whether every element in left corresponds to a matching element in right at the same position.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<boolean>

  • Computes a scalar value indicating whether every element in left corresponds to a matching element in right at the same position.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    Returns Promise<boolean>

correspondsBy

  • correspondsBy<T, K>(left: Queryable<T>, right: Queryable<T>, keySelector: function): boolean
  • correspondsBy<T, U, K>(left: Queryable<T>, right: Queryable<U>, leftKeySelector: function, rightKeySelector: function, keyEqualer?: EqualityComparison<K> | Equaler<K>): boolean
  • Computes a scalar value indicating whether the key for every element in left corresponds to a matching key in right at the same position.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns boolean

  • Computes a scalar value indicating whether the key for every element in left corresponds to a matching key in right at the same position.

    category

    Scalar

    Type parameters

    • T
    • U
    • K

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<U>

      A Queryable object.

    • leftKeySelector: function

      A callback used to select the key for each element in left.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • rightKeySelector: function

      A callback used to select the key for each element in right.

        • (element: U): K
        • Parameters

          • element: U

          Returns K

    • Optional keyEqualer: EqualityComparison<K> | Equaler<K>

      An optional callback used to compare the equality of two keys.

    Returns boolean

correspondsByAsync

  • Computes a scalar value indicating whether the key for every element in left corresponds to a matching key in right at the same position.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the key for every element in left corresponds to a matching key in right at the same position.

    category

    Scalar

    Type parameters

    • T
    • U
    • K

    Parameters

    • left: AsyncQueryable<T>

      An AsyncQueryable object.

    • right: AsyncQueryable<U>

      An AsyncQueryable object.

    • leftKeySelector: function

      A callback used to select the key for each element in left.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • rightKeySelector: function

      A callback used to select the key for each element in right.

        • (element: U): K
        • Parameters

          • element: U

          Returns K

    • Optional keyEqualer: EqualityComparison<K> | Equaler<K>

      An optional callback used to compare the equality of two keys.

    Returns Promise<boolean>

count

  • count<T>(source: Queryable<T>, predicate?: function): number
  • Counts the number of elements, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns number

countAsync

  • Counts the number of elements, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      A Queryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns Promise<number>

drain

drainAsync

elementAt

  • elementAt<T>(source: Queryable<T>, offset: number): T | undefined
  • Finds the value at the provided offset. A negative offset starts from the last element.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns T | undefined

elementAtAsync

endsWith

  • endsWith<T>(left: Queryable<T>, right: Queryable<T>, equaler?: EqualityComparison<T> | Equaler<T>): boolean
  • endsWith<T, U>(left: Queryable<T>, right: Queryable<U>, equaler: function): boolean
  • Computes a scalar value indicating whether the elements of left end with the same sequence of elements in right.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      An optional callback used to compare the equality of two elements.

    Returns boolean

  • Computes a scalar value indicating whether the elements of left end with the same sequence of elements in right.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<U>

      A Queryable object.

    • equaler: function

      An optional callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns boolean

endsWithAsync

  • Computes a scalar value indicating whether the elements of left end with the same sequence of elements in right.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the elements of left end with the same sequence of elements in right.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    Returns Promise<boolean>

evalAsync

every

  • every<T, U>(source: Queryable<T>, predicate: function): boolean
  • every<T>(source: Queryable<T>, predicate: function): boolean
  • Computes a scalar value indicating whether all elements match the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • U: T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns boolean

  • Computes a scalar value indicating whether all elements match the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns boolean

everyAsync

  • Computes a scalar value indicating whether all elements match the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns Promise<boolean>

first

  • first<T>(source: Queryable<T>, predicate?: function): T | undefined
  • Gets the first element, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns T | undefined

firstAsync

  • Gets the first element, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • U: T

    Parameters

    • source: AsyncQueryable<T>

      A Queryable object.

    • predicate: function

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Promise<U | undefined>

  • Gets the first element, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      A Queryable object.

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<T | undefined>

forEach

  • forEach<T>(source: Queryable<T>, callback: function): void
  • Invokes a callback for each element of source.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns void

forEachAsync

  • Invokes a callback for each element of source.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void | PromiseLike<void>
        • Parameters

          • element: T
          • offset: number

          Returns void | PromiseLike<void>

    Returns Promise<void>

includes

  • includes<T>(source: Queryable<T>, value: T, equaler?: EqualityComparison<T> | Equaler<T>): boolean
  • includes<T, U>(source: Queryable<T>, value: U, equaler: function): boolean
  • Computes a scalar value indicating whether the provided value is included in a Queryable.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • value: T

      A value.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      An optional callback used to compare the equality of two elements.

    Returns boolean

  • Computes a scalar value indicating whether the provided value is included in a Queryable.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • value: U

      A value.

    • equaler: function

      An optional callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns boolean

includesAsync

  • includesAsync<T>(source: AsyncQueryable<T>, value: T, equaler?: EqualityComparison<T> | Equaler<T>): Promise<boolean>
  • includesAsync<T, U>(source: AsyncQueryable<T>, value: U, equaler: function): Promise<boolean>
  • Computes a scalar value indicating whether the provided value is included in an AsyncQueryable.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • value: T

      A value.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      An optional callback used to compare the equality of two elements.

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the provided value is included in an AsyncQueryable.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • value: U

      A value.

    • equaler: function

      An optional callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns Promise<boolean>

includesSequence

  • includesSequence<T>(left: Queryable<T>, right: Queryable<T>, equaler?: EqualityComparison<T> | Equaler<T>): boolean
  • includesSequence<T, U>(left: Queryable<T>, right: Queryable<U>, equaler: function): boolean
  • Computes a scalar value indicating whether the elements of left include an exact sequence of elements from right.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      A callback used to compare the equality of two elements.

    Returns boolean

  • Computes a scalar value indicating whether the elements of left include an exact sequence of elements from right.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<U>

      A Queryable object.

    • equaler: function

      A callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns boolean

includesSequenceAsync

  • Computes a scalar value indicating whether the elements of left include an exact sequence of elements from right.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the elements of left include an exact sequence of elements from right.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    Returns Promise<boolean>

last

  • last<T>(source: Queryable<T>, predicate?: function): T | undefined
  • Gets the last element of a Queryable, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns T | undefined

lastAsync

  • Gets the last element of a Queryable, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • U: T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Promise<U | undefined>

  • Gets the last element of a Queryable, optionally filtering elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<T | undefined>

max

  • max<T>(source: Queryable<T>, comparer?: Comparison<T> | Comparer<T>): T | undefined
  • Gets the maximum element of a Queryable, optionally comparing elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value comparer: Comparison<T> | Comparer<T> = Comparer.defaultComparer

      An optional callback used to compare two elements.

    Returns T | undefined

maxAsync

  • Gets the maximum element of an AsyncQueryable, optionally comparing elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • Default value comparer: Comparison<T> | Comparer<T> = Comparer.defaultComparer

      An optional callback used to compare two elements.

    Returns Promise<T | undefined>

maxBy

  • maxBy<T, K>(source: Queryable<T>, keySelector: function, keyComparer?: Comparison<K> | Comparer<K>): T | undefined
  • Gets the maximum element of a Queryable, optionally comparing the keys of each element using the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to choose the key to compare.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Default value keyComparer: Comparison<K> | Comparer<K> = Comparer.defaultComparer

      An optional callback used to compare the keys.

    Returns T | undefined

maxByAsync

  • maxByAsync<T, K>(source: AsyncQueryable<T>, keySelector: function, keyComparer?: Comparison<K> | Comparer<K>): Promise<T | undefined>
  • Gets the maximum element of an AsyncQueryable, optionally comparing the keys of each element using the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to choose the key to compare.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Default value keyComparer: Comparison<K> | Comparer<K> = Comparer.defaultComparer

      An optional callback used to compare the keys.

    Returns Promise<T | undefined>

min

  • min<T>(source: Queryable<T>, comparer?: Comparison<T> | Comparer<T>): T | undefined
  • Gets the minimum element of a Queryable, optionally comparing elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value comparer: Comparison<T> | Comparer<T> = Comparer.defaultComparer

      An optional callback used to compare two elements.

    Returns T | undefined

minAsync

  • Gets the minimum element of an AsyncQueryable, optionally comparing elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • Default value comparer: Comparison<T> | Comparer<T> = Comparer.defaultComparer

      An optional callback used to compare two elements.

    Returns Promise<T | undefined>

minBy

  • minBy<T, K>(source: Queryable<T>, keySelector: function, keyComparer?: Comparison<K> | Comparer<K>): T | undefined
  • Gets the minimum element of a Queryable, optionally comparing the keys of each element using the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to choose the key to compare.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Default value keyComparer: Comparison<K> | Comparer<K> = Comparer.defaultComparer

      An optional callback used to compare the keys.

    Returns T | undefined

minByAsync

  • minByAsync<T, K>(source: AsyncQueryable<T>, keySelector: function, keyComparer?: Comparison<K> | Comparer<K>): Promise<T | undefined>
  • Gets the minimum element of an AsyncQueryable, optionally comparing the keys of each element using the supplied callback.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to choose the key to compare.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Default value keyComparer: Comparison<K> | Comparer<K> = Comparer.defaultComparer

      An optional callback used to compare the keys.

    Returns Promise<T | undefined>

reduce

  • reduce<T>(source: Queryable<T>, accumulator: function): T
  • reduce<T, U>(source: Queryable<T>, accumulator: function, seed: U, resultSelector?: undefined | function): U
  • reduce<T, U, R>(source: Queryable<T>, accumulator: function, seed: U, resultSelector: function): R
  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: T, element: T, offset: number): T
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T

    Returns T

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U

    • seed: U

      An optional seed value.

    • Optional resultSelector: undefined | function

      An optional callback used to compute the final result.

    Returns U

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • T
    • U
    • R

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U

    • seed: U

      An optional seed value.

    • resultSelector: function

      An optional callback used to compute the final result.

        • (result: U, count: number): R
        • Parameters

          • result: U
          • count: number

          Returns R

    Returns R

reduceAsync

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns Promise<T>

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    Returns Promise<U>

  • Computes a scalar value by applying an accumulator callback over each element.

    category

    Scalar

    Type parameters

    • T
    • U
    • R

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<T>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<T>

    • seed: U

      An optional seed value.

    • resultSelector: function

      An optional callback used to compute the final result.

        • (result: U, count: number): R | PromiseLike<R>
        • Parameters

          • result: U
          • count: number

          Returns R | PromiseLike<R>

    Returns Promise<R>

reduceRight

  • reduceRight<T>(source: Queryable<T>, accumulator: function): T
  • reduceRight<T, U>(source: Queryable<T>, accumulator: function, seed: U, resultSelector?: undefined | function): U
  • reduceRight<T, U, R>(source: Queryable<T>, accumulator: function, seed: U, resultSelector: function): R
  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: T, element: T, offset: number): T
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T

    Returns T

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U

    • seed: U

      An optional seed value.

    • Optional resultSelector: undefined | function

      An optional callback used to compute the final result.

    Returns U

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • T
    • U
    • R

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U

    • seed: U

      An optional seed value.

    • resultSelector: function

      An optional callback used to compute the final result.

        • (result: U, count: number): R
        • Parameters

          • result: U
          • count: number

          Returns R

    Returns R

reduceRightAsync

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns Promise<T>

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    Returns Promise<U>

  • Computes a scalar value by applying an accumulator callback over each element in reverse.

    category

    Scalar

    Type parameters

    • T
    • U
    • R

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      the callback used to compute the result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    • resultSelector: function

      An optional callback used to compute the final result.

        • (result: U, count: number): R | PromiseLike<R>
        • Parameters

          • result: U
          • count: number

          Returns R | PromiseLike<R>

    Returns Promise<R>

single

  • single<T>(source: Queryable<T>, predicate?: function): undefined | T
  • Gets the only element, or returns undefined.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns undefined | T

singleAsync

  • Gets the only element, or returns undefined.

    category

    Scalar

    Type parameters

    • T
    • U: T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Promise<U | undefined>

  • Gets the only element, or returns undefined.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • Optional predicate: undefined | function

      An optional callback used to match each element.

    Returns Promise<T | undefined>

some

  • some<T>(source: Queryable<T>, predicate?: function): boolean
  • Computes a scalar value indicating whether source contains any elements, optionally filtering the elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns boolean

someAsync

  • Computes a scalar value indicating whether source contains any elements, optionally filtering the elements using the supplied callback.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • Default value predicate: function = T

      An optional callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns Promise<boolean>

span

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[Iterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[Iterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns [HierarchyIterable<TNode, U>, HierarchyIterable<TNode, T>]

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[Iterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[Iterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns [HierarchyIterable<TNode, T>, HierarchyIterable<TNode, T>]

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[Iterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[Iterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • T
    • U: T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns [Iterable<U>, Iterable<T>]

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[Iterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[Iterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns [Iterable<T>, Iterable<T>]

spanAsync

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[AsyncIterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[AsyncIterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns Promise<[HierarchyIterable<TNode, U>, AsyncHierarchyIterable<TNode, T>]>

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[AsyncIterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[AsyncIterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • element: T
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns Promise<[HierarchyIterable<TNode, T>, AsyncHierarchyIterable<TNode, T>]>

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[AsyncIterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[AsyncIterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • T
    • U: T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns Promise<[Iterable<U>, AsyncIterable<T>]>

  • Creates a tuple whose first element is an [[Iterable]] containing the first span of elements that match the supplied predicate, and whose second element is an [[AsyncIterable]] containing the remaining elements.

    The first [[Iterable]] is eagerly evaluated, while the second [[AsyncIterable]] is lazily evaluated.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      The predicate used to match elements.

        • (element: T, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • element: T
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns Promise<[Iterable<T>, AsyncIterable<T>]>

startsWith

  • startsWith<T>(left: Queryable<T>, right: Queryable<T>, equaler?: EqualityComparison<T> | Equaler<T>): boolean
  • startsWith<T, U>(left: Queryable<T>, right: Queryable<U>, equaler: function): boolean
  • Computes a scalar value indicating whether the elements of this Query start with the same sequence of elements in another Queryable.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • Optional equaler: EqualityComparison<T> | Equaler<T>

      A callback used to compare the equality of two elements.

    Returns boolean

  • Computes a scalar value indicating whether the elements of this Query start with the same sequence of elements in another Queryable.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<U>

      A Queryable object.

    • equaler: function

      A callback used to compare the equality of two elements.

        • (left: T, right: U): boolean
        • Parameters

          • left: T
          • right: U

          Returns boolean

    Returns boolean

startsWithAsync

  • Computes a scalar value indicating whether the elements of this Query start with the same sequence of elements in another Queryable.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<boolean>

  • Computes a scalar value indicating whether the elements of this Query start with the same sequence of elements in another Queryable.

    category

    Scalar

    Type parameters

    • T
    • U

    Parameters

    Returns Promise<boolean>

sum

  • sum(source: Queryable<number>): number
  • sum<T>(source: Queryable<T>, elementSelector: function): number
  • Computes the sum for a series of numbers.

    category

    Scalar

    Parameters

    Returns number

  • Computes the sum for a series of numbers.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • elementSelector: function

      A callback used to convert a value in source to a number.

        • (element: T): number
        • Parameters

          • element: T

          Returns number

    Returns number

sumAsync

  • Computes the sum for a series of numbers. NOTE: If any element is not a number, this overload will throw.

    category

    Scalar

    Parameters

    Returns Promise<number>

  • Computes the sum for a series of numbers.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • elementSelector: function

      A callback used to convert a value in source to a number.

        • (element: T): number | PromiseLike<number>
        • Parameters

          • element: T

          Returns number | PromiseLike<number>

    Returns Promise<number>

toArray

  • toArray<T>(source: Queryable<T>): T[]
  • toArray<T, V>(source: Queryable<T>, elementSelector: function): V[]
  • Creates an Array for the elements of the Queryable.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns T[]

  • Creates an Array for the elements of the Queryable.

    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    Returns V[]

toArrayAsync

  • Creates an Array for the elements of the [[AsyncIterable]].

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<T[]>

  • Creates an Array for the elements of the [[AsyncIterable]].

    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns Promise<V[]>

toLookup

  • toLookup<T, K>(source: Queryable<T>, keySelector: function, keyEqualer?: Equaler<K>): Lookup<K, T>
  • toLookup<T, K, V>(source: Queryable<T>, keySelector: function, elementSelector: function, keyEqualer?: Equaler<K>): Lookup<K, V>
  • Creates a Lookup for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Lookup<K, T>

  • Creates a Lookup for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Lookup<K, V>

toLookupAsync

  • Creates a Lookup for the elements of the source.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<Lookup<K, T>>

  • Creates a Lookup for the elements of the source.

    category

    Scalar

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<Lookup<K, V>>

toMap

  • toMap<T, K>(source: Queryable<T>, keySelector: function): Map<K, T>
  • toMap<T, K>(source: Queryable<T>, keySelector: function, keyEqualer: Equaler<K>): HashMap<K, T>
  • toMap<T, K, V>(source: Queryable<T>, keySelector: function, elementSelector: function): Map<K, V>
  • toMap<T, K, V>(source: Queryable<T>, keySelector: function, elementSelector: function, keyEqualer: Equaler<K>): HashMap<K, V>
  • Creates a Map for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns Map<K, T>

  • Creates a Map for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HashMap<K, T>

  • Creates a Map for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    Returns Map<K, V>

  • Creates a Map for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HashMap<K, V>

toMapAsync

  • toMapAsync<T, K>(source: AsyncQueryable<T>, keySelector: function): Promise<Map<K, T>>
  • toMapAsync<T, K>(source: AsyncQueryable<T>, keySelector: function, keyEqualer: Equaler<K>): Promise<HashMap<K, T>>
  • toMapAsync<T, K, V>(source: AsyncQueryable<T>, keySelector: function, elementSelector: function): Promise<Map<K, V>>
  • toMapAsync<T, K, V>(source: AsyncQueryable<T>, keySelector: function, elementSelector: function, keyEqualer: Equaler<K>): Promise<HashMap<K, V>>
  • Creates a Map for the elements of the source.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns Promise<Map<K, T>>

  • Creates a Map for the elements of the source.

    category

    Scalar

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<HashMap<K, T>>

  • Creates a Map for the elements of the source.

    category

    Scalar

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns Promise<Map<K, V>>

  • Creates a Map for the elements of the source.

    category

    Scalar

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Promise<HashMap<K, V>>

toObject

  • toObject<T>(source: Queryable<T>, prototype: object | null | undefined, keySelector: function): object
  • toObject<T, V>(source: Queryable<T>, prototype: object | null | undefined, keySelector: function, elementSelector: function, descriptorSelector?: undefined | function): object
  • Creates an Object for the elements of source. Properties are added via Object.defineProperty.

    // As a regular object
    const obj = toObject([["x", 1], ["y", 2]], undefined, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // function
    
    // with a custom prototype
    const baseObject = { toString() { return `${this.x}:${this.y}` } };
    const obj = toObject([["x", 1], ["y", 2]], baseObject, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // function
    obj.toString(); // "x",1:"y",2
    
    // with a null prototype
    const obj = toObject([["x", 1], ["y", 2]], null, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // undefined
    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • prototype: object | null | undefined

      The prototype for the object. If prototype is null, an object with a null prototype is created. If prototype is undefined, the default Object.prototype is used.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): PropertyKey
        • Parameters

          • element: T

          Returns PropertyKey

    Returns object

  • Creates an Object for the elements of source. Properties are added via Object.defineProperty.

    // As a regular object
    const obj = toObject([["x", 1], ["y", 2]], undefined, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // function
    
    // with a custom prototype
    const baseObject = { toString() { return `${this.x}:${this.y}` } };
    const obj = toObject([["x", 1], ["y", 2]], baseObject, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // function
    obj.toString(); // 1:2
    
    // with a null prototype
    const obj = toObject([["x", 1], ["y", 2]], null, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // undefined
    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • prototype: object | null | undefined

      The prototype for the object. If prototype is null, an object with a null prototype is created. If prototype is undefined, the default Object.prototype is used.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): PropertyKey
        • Parameters

          • element: T

          Returns PropertyKey

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • Optional descriptorSelector: undefined | function

      A callback that defines the PropertyDescriptor for each property.

    Returns object

toObjectAsync

  • toObjectAsync<T>(source: AsyncQueryable<T>, prototype: object | null | undefined, keySelector: function): Promise<object>
  • toObjectAsync<T, V>(source: AsyncQueryable<T>, prototype: object | null | undefined, keySelector: function, elementSelector: function, descriptorSelector?: undefined | function): Promise<object>
  • Creates an Object for the elements of source. Properties are added via Object.defineProperty.

    // As a regular object
    const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], undefined, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // function
    
    // with a custom prototype
    const baseObject = { toString() { return `${this.x}:${this.y}` } };
    const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], baseObject, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // function
    obj.toString(); // "x",1:"y",2
    
    // with a null prototype
    const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0]);
    obj.x; // ["x", 1]
    obj.y; // ["y", 2]
    typeof obj.toString; // undefined
    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • prototype: object | null | undefined

      The prototype for the object. If prototype is null, an object with a null prototype is created. If prototype is undefined, the default Object.prototype is used.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): PropertyKey
        • Parameters

          • element: T

          Returns PropertyKey

    Returns Promise<object>

  • Creates an Object for the elements of source. Properties are added via Object.defineProperty.

    // As a regular object
    const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], undefined, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // function
    
    // with a custom prototype
    const baseObject = { toString() { return `${this.x}:${this.y}` } };
    const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], baseObject, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // function
    obj.toString(); // 1:2
    
    // with a null prototype
    const obj = await toObjectAsync([Promise.resolve(["x", 1]), ["y", 2]], null, a => a[0], a => a[1]);
    obj.x; // 1
    obj.y; // 2
    typeof obj.toString; // undefined
    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • prototype: object | null | undefined

      The prototype for the object. If prototype is null, an object with a null prototype is created. If prototype is undefined, the default Object.prototype is used.

    • keySelector: function

      A callback used to select a key for each element.

        • (element: T): PropertyKey
        • Parameters

          • element: T

          Returns PropertyKey

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • Optional descriptorSelector: undefined | function

      A callback that defines the PropertyDescriptor for each property.

    Returns Promise<object>

toSet

  • toSet<T>(source: Queryable<T>): Set<T>
  • toSet<T>(source: Queryable<T>, equaler: Equaler<T>): HashSet<T>
  • toSet<T, V>(source: Queryable<T>, elementSelector: function): Set<V>
  • toSet<T, V>(source: Queryable<T>, elementSelector: function, equaler: Equaler<V>): HashSet<V>
  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Set<T>

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • equaler: Equaler<T>

      An [[Equaler]] object used to compare equality.

    Returns HashSet<T>

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    Returns Set<V>

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • equaler: Equaler<V>

      An [[Equaler]] object used to compare equality.

    Returns HashSet<V>

toSetAsync

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<Set<T>>

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T

    Parameters

    Returns Promise<HashSet<T>>

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns Promise<Set<V>>

  • Creates a Set for the elements of the Query.

    category

    Scalar

    Type parameters

    • T
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • elementSelector: function

      A callback that selects a value for each element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • equaler: Equaler<V>

      An [[Equaler]] object used to compare equality.

    Returns Promise<HashSet<V>>

unzip

  • unzip<T>(source: Queryable<T>): object
  • unzip<T, U>(source: Queryable<T>, partSelector: function): object
  • Unzips a sequence of tuples into a tuple of sequences.

    category

    Scalar

    Type parameters

    • T: [any, Array]

    Parameters

    Returns object

  • Unzips a sequence of tuples into a tuple of sequences.

    category

    Scalar

    Type parameters

    • T
    • U: [any, Array]

    Parameters

    • source: Queryable<T>
    • partSelector: function

      A callback that converts a result into a tuple.

        • (value: T): U
        • Parameters

          • value: T

          Returns U

    Returns object

unzipAsync

  • Unzips a sequence of tuples into a tuple of sequences.

    category

    Scalar

    Type parameters

    • T: [any, Array]

    Parameters

    Returns Promise<object>

  • Unzips a sequence of tuples into a tuple of sequences.

    category

    Scalar

    Type parameters

    • T
    • U: [any, Array]

    Parameters

    • source: AsyncQueryable<T>
    • partSelector: function

      A callback that converts a result into a tuple.

        • (value: T): U | PromiseLike<U>
        • Parameters

          • value: T

          Returns U | PromiseLike<U>

    Returns Promise<object>

Functions (Subquery)

append

appendAsync

concat

concatAsync

defaultIfEmpty

defaultIfEmptyAsync

distinct

distinctAsync

distinctBy

  • Creates a HierarchyIterable for the distinct elements of source.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key to determine uniqueness.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates an [[Iterable]] for the distinct elements of source.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key to determine uniqueness.

        • (value: T): K
        • Parameters

          • value: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<T>

distinctByAsync

except

exceptAsync

exceptBy

  • Creates a HierarchyIterable for the set difference between a HierarchyIterable and a Queryable object, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates an [[Iterable]] for the set difference between two Queryable objects, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • left: Queryable<T>

      A HierarchyIterable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<T>

exceptByAsync

exclude

excludeAsync

expand

  • Creates a HierarchyIterable that iterates the results of recursively expanding the elements of source.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • U: TNode

    Parameters

    Returns HierarchyIterable<TNode, U>

  • Creates an [[Iterable]] that iterates the results of recursively expanding the elements of the source.

    category

    Subquery

    Type parameters

    • T

    Parameters

    Returns Iterable<T>

expandAsync

filter

  • Creates a HierarchyIterable whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns HierarchyIterable<TNode, U>

  • Creates a HierarchyIterable whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • U: TNode

    Parameters

    • source: HierarchyIterable<TNode>

      A HierarchyIterable object.

    • predicate: function

      A callback used to match each element.

        • (element: TNode, offset: number): boolean
        • Parameters

          • element: TNode
          • offset: number

          Returns boolean

    Returns HierarchyIterable<TNode, U>

  • Creates a HierarchyIterable whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns HierarchyIterable<TNode, T>

  • Creates an [[Iterable]] whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • U: T

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns Iterable<U>

  • Creates an [[Iterable]] whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • predicate: function

      A callback used to match each element.

        • (element: T, offset: number): boolean
        • Parameters

          • element: T
          • offset: number

          Returns boolean

    Returns Iterable<T>

filterAsync

filterBy

  • Creates a HierarchyIterable where the selected key for each element matches the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • predicate: function

      A callback used to match each key.

        • (key: K, offset: number): boolean
        • Parameters

          • key: K
          • offset: number

          Returns boolean

    Returns HierarchyIterable<TNode, T>

  • Creates an [[Iterable]] where the selected key for each element matches the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • predicate: function

      A callback used to match each key.

        • (key: K, offset: number): boolean
        • Parameters

          • key: K
          • offset: number

          Returns boolean

    Returns Iterable<T>

filterByAsync

  • Creates an AsyncHierarchyIterable whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>
    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • predicate: function

      A callback used to match each key.

        • (key: K, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • key: K
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates an [[AsyncIterable]] whose elements match the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>
    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • predicate: function

      A callback used to match each key.

        • (key: K, offset: number): boolean | PromiseLike<boolean>
        • Parameters

          • key: K
          • offset: number

          Returns boolean | PromiseLike<boolean>

    Returns AsyncIterable<T>

filterDefined

filterDefinedAsync

flatMap

  • flatMap<T, U>(source: Queryable<T>, projection: function): Iterable<U>
  • flatMap<T, U, R>(source: Queryable<T>, projection: function, resultSelector: function): Iterable<R>
  • Creates an [[Iterable]] that iterates the results of applying a callback to each element of source.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • projection: function

      A callback used to map each element into an iterable.

    Returns Iterable<U>

  • Creates an [[Iterable]] that iterates the results of applying a callback to each element of source.

    category

    Subquery

    Type parameters

    • T
    • U
    • R

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • projection: function

      A callback used to map each element into an iterable.

    • resultSelector: function
        • (element: T, innerElement: U): R
        • Parameters

          • element: T
          • innerElement: U

          Returns R

    Returns Iterable<R>

flatMapAsync

  • Creates an [[AsyncIterable]] that iterates the results of applying a callback to each element of source.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    Returns AsyncIterable<U>

  • Creates an [[AsyncIterable]] that iterates the results of applying a callback to each element of source.

    category

    Subquery

    Type parameters

    • T
    • U
    • R

    Parameters

    • source: AsyncQueryable<T>

      A Queryable object.

    • projection: function

      A callback used to map each element into an iterable.

    • resultSelector: function
        • (element: T, innerElement: U): R | PromiseLike<R>
        • Parameters

          • element: T
          • innerElement: U

          Returns R | PromiseLike<R>

    Returns AsyncIterable<R>

groupBy

  • groupBy<TNode, T, K>(source: HierarchyIterable<TNode, T>, keySelector: function, keyEqualer?: Equaler<K>): Iterable<HierarchyGrouping<K, TNode, T>>
  • groupBy<T, K>(source: Queryable<T>, keySelector: function, keyEqualer?: Equaler<K>): Iterable<Grouping<K, T>>
  • groupBy<T, K, V>(source: Queryable<T>, keySelector: function, elementSelector: function, keyEqualer?: Equaler<K>): Iterable<Grouping<K, V>>
  • groupBy<T, K, V, R>(source: Queryable<T>, keySelector: function, elementSelector: function, resultSelector: function, keyEqualer?: Equaler<K>): Iterable<R>
  • Groups each element of a HierarchyIterable by its key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<HierarchyGrouping<K, TNode, T>>

  • Groups each element of a Queryable by its key.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<Grouping<K, T>>

  • Groups each element of a Queryable by its key.

    category

    Subquery

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<Grouping<K, V>>

  • Groups each element of a Queryable by its key.

    category

    Subquery

    Type parameters

    • T
    • K
    • V
    • R

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • resultSelector: function

      A callback used to select a result from a group.

        • Parameters

          Returns R

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<R>

groupByAsync

intersect

intersectAsync

intersectBy

  • Creates a HierarchyIterable for the set intersection of a HierarchyIterable object and a Queryable object, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a HierarchyIterable for the set intersection of a Queryable object and a HierarchyIterable object, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: Queryable<T>

      A HierarchyIterable object.

    • right: HierarchyIterable<TNode, T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates an [[Iterable]] for the set intersection of two Queryable objects, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • left: Queryable<T>

      A HierarchyIterable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<T>

intersectByAsync

map

  • Creates an [[Iterable]] by applying a callback to each element of a Queryable.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • selector: function

      A callback used to map each element.

        • (element: T, offset: number): U
        • Parameters

          • element: T
          • offset: number

          Returns U

    Returns Iterable<U>

mapAsync

  • Creates an [[AsyncIterable]] by applying a callback to each element of an AsyncQueryable.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • selector: function

      A callback used to map each element.

        • (element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    Returns AsyncIterable<U>

pageBy

  • Creates a HierarchyIterable that splits a Queryable into one or more pages. While advancing from page to page is evaluated lazily, the elements of the page are evaluated eagerly.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns Iterable<HierarchyPage<TNode, T>>

  • Creates an [[Iterable]] that splits a Queryable into one or more pages. While advancing from page to page is evaluated lazily, the elements of the page are evaluated eagerly.

    category

    Subquery

    Type parameters

    • T

    Parameters

    Returns Iterable<Page<T>>

pageByAsync

patch

  • Creates a HierarchyIterable for the elements of source with the provided range patched into the results.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      The HierarchyIterable to patch.

    • start: number

      The offset at which to patch the range.

    • Optional skipCount: undefined | number

      The number of elements to skip from start.

    • Optional range: Queryable<T>

      The range to patch into the result.

    Returns HierarchyIterable<TNode, T>

  • Creates an [[Iterable]] for the elements of source with the provided range patched into the results.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      The HierarchyIterable to patch.

    • start: number

      The offset at which to patch the range.

    • Optional skipCount: undefined | number

      The number of elements to skip from start.

    • Optional range: Queryable<T>

      The range to patch into the result.

    Returns Iterable<T>

patchAsync

prepend

  • Creates a subquery for the elements of the source with the provided value prepended to the beginning.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the elements of the source with the provided value prepended to the beginning.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>
    • value: T

      The value to prepend.

    Returns Iterable<T>

prependAsync

reverse

reverseAsync

scan

  • Creates a subquery containing the cumulative results of applying the provided callback to each element.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: T, element: T, offset: number): T
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T

    Returns Iterable<T>

  • Creates a subquery containing the cumulative results of applying the provided callback to each element.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: U, element: T, offset: number): U
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U

    • seed: U

      An optional seed value.

    Returns Iterable<U>

scanAsync

  • Creates a subquery containing the cumulative results of applying the provided callback to each element.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns AsyncIterable<T>

  • Creates a subquery containing the cumulative results of applying the provided callback to each element.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    Returns AsyncIterable<U>

scanRight

  • Creates a subquery containing the cumulative results of applying the provided callback to each element in reverse.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: T, element: T, offset: number): T
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T

    Returns Iterable<T>

  • Creates a subquery containing the cumulative results of applying the provided callback to each element in reverse.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: U, element: T, offset: number): U
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U

    • seed: U

      An optional seed value.

    Returns Iterable<U>

scanRightAsync

  • Creates a subquery containing the cumulative results of applying the provided callback to each element in reverse.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: T, element: T, offset: number): T | PromiseLike<T>
        • Parameters

          • current: T
          • element: T
          • offset: number

          Returns T | PromiseLike<T>

    Returns AsyncIterable<T>

  • Creates a subquery containing the cumulative results of applying the provided callback to each element in reverse.

    category

    Subquery

    Type parameters

    • T
    • U

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • accumulator: function

      The callback used to compute each result.

        • (current: U, element: T, offset: number): U | PromiseLike<U>
        • Parameters

          • current: U
          • element: T
          • offset: number

          Returns U | PromiseLike<U>

    • seed: U

      An optional seed value.

    Returns AsyncIterable<U>

skip

  • Creates a subquery containing all elements except the first elements up to the supplied count.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing all elements except the first elements up to the supplied count.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • count: number

      The number of elements to skip.

    Returns Iterable<T>

skipAsync

skipRight

  • Creates a subquery containing all elements except the first elements up to the supplied count.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing all elements except the first elements up to the supplied count.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • count: number

      The number of elements to skip.

    Returns Iterable<T>

skipRightAsync

skipUntil

  • Creates a subquery containing all elements except the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing all elements except the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Iterable<T>

skipUntilAsync

  • Creates a subquery containing all elements except the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates a subquery containing all elements except the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncIterable<T>

skipWhile

  • Creates a subquery containing all elements except the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing all elements except the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Iterable<T>

skipWhileAsync

  • Creates a subquery containing all elements except the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates a subquery containing all elements except the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncIterable<T>

spanMap

  • Creates a subquery whose elements are the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns Iterable<HierarchyGrouping<K, TNode, T>>

  • Creates a subquery whose elements are the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns Iterable<Grouping<K, T>>

  • Creates a subquery whose values are computed from each element of the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    Returns Iterable<Grouping<K, V>>

  • Creates a subquery whose values are computed from the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • T
    • K
    • V
    • R

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V
        • Parameters

          • element: T

          Returns V

    • spanSelector: function

      A callback used to select a result from a contiguous range.

        • Parameters

          Returns R

    Returns Iterable<R>

spanMapAsync

  • Creates a subquery whose elements are the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    Returns AsyncIterable<HierarchyGrouping<K, TNode, T>>

  • Creates a subquery whose elements are the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    Returns AsyncIterable<Grouping<K, T>>

  • Creates a subquery whose values are computed from each element of the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • T
    • K
    • V

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    Returns AsyncIterable<Grouping<K, V>>

  • Creates a subquery whose values are computed from the contiguous ranges of elements that share the same key.

    category

    Subquery

    Type parameters

    • T
    • K
    • V
    • R

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • elementSelector: function

      A callback used to select a value for an element.

        • (element: T): V | PromiseLike<V>
        • Parameters

          • element: T

          Returns V | PromiseLike<V>

    • spanSelector: function

      A callback used to select a result from a contiguous range.

        • (key: K, elements: Iterable<V>): R | PromiseLike<R>
        • Parameters

          Returns R | PromiseLike<R>

    Returns AsyncIterable<R>

symmetricDifference

  • Creates a subquery for the symmetric difference between two Queryable objects. The result is an [[Iterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the symmetric difference between two Queryable objects. The result is an [[Iterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the symmetric difference between two Queryable objects. The result is an [[Iterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • T

    Parameters

    Returns Iterable<T>

symmetricDifferenceAsync

symmetricDifferenceBy

  • Creates a subquery for the symmetric difference between two Queryable objects, where set identity is determined by the selected key. The result is an [[Iterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: HierarchyIterable<TNode, T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the symmetric difference between two Queryable objects, where set identity is determined by the selected key. The result is an [[Iterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: HierarchyIterable<TNode, T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the symmetric difference between two Queryable objects, where set identity is determined by the selected key. The result is an [[Iterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • left: Queryable<T>

      A Queryable object.

    • right: Queryable<T>

      A Queryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<T>

symmetricDifferenceByAsync

  • Creates a subquery for the symmetric difference between two AsyncQueryable objects, where set identity is determined by the selected key. The result is an [[AsyncIterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates a subquery for the symmetric difference between two AsyncQueryable objects, where set identity is determined by the selected key. The result is an [[AsyncIterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates a subquery for the symmetric difference between two AsyncQueryable objects, where set identity is determined by the selected key. The result is an [[AsyncIterable]] containings the elements that exist in only left or right, but not in both.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • left: AsyncQueryable<T>

      An AsyncQueryable object.

    • right: AsyncQueryable<T>

      An AsyncQueryable object.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncIterable<T>

take

  • Creates a subquery containing the first elements up to the supplied count.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing the first elements up to the supplied count.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • count: number

      The number of elements to take.

    Returns Iterable<T>

takeAsync

takeRight

  • Creates a subquery containing the last elements up to the supplied count.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing the last elements up to the supplied count.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • count: number

      The number of elements to take.

    Returns Iterable<T>

takeRightAsync

takeUntil

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns HierarchyIterable<TNode, U>

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • U: T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Iterable<U>

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Iterable<T>

takeUntilAsync

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    Returns AsyncHierarchyIterable<TNode, U>

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • U: T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns AsyncIterable<U>

  • Creates a subquery containing the first elements that do not match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncIterable<T>

takeWhile

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns HierarchyIterable<TNode, U>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • U: T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Iterable<U>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns Iterable<T>

takeWhileAsync

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    Returns AsyncHierarchyIterable<TNode, U>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncHierarchyIterable<TNode, T>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • T
    • U: T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean
        • Parameters

          • element: T

          Returns boolean

    Returns AsyncIterable<U>

  • Creates a subquery containing the first elements that match the supplied predicate.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • predicate: function

      A callback used to match each element.

        • (element: T): boolean | PromiseLike<boolean>
        • Parameters

          • element: T

          Returns boolean | PromiseLike<boolean>

    Returns AsyncIterable<T>

tap

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: HierarchyIterable<TNode, T>

      A Queryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns HierarchyIterable<TNode, T>

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: Queryable<T>

      A Queryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns Iterable<T>

tapAsync

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns AsyncHierarchyIterable<TNode, T>

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void>
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void>

    Returns AsyncHierarchyIterable<TNode, T>

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • source: PossiblyAsyncHierarchyIterable<TNode, T>

      An AsyncQueryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void> | void
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void> | void

    Returns AsyncHierarchyIterable<TNode, T>

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): void
        • Parameters

          • element: T
          • offset: number

          Returns void

    Returns AsyncIterable<T>

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void>
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void>

    Returns AsyncIterable<T>

  • Lazily invokes a callback as each element of the iterable is iterated.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • source: AsyncQueryable<T>

      An AsyncQueryable object.

    • callback: function

      The callback to invoke.

        • (element: T, offset: number): PromiseLike<void> | void
        • Parameters

          • element: T
          • offset: number

          Returns PromiseLike<void> | void

    Returns AsyncIterable<T>

through

  • through<T, S, R>(source: S, callback: function): R
  • Pass the entire source to the provided callback, returning a Queryable from the result.

    category

    Subquery

    Type parameters

    Parameters

    • source: S

      A Queryable object.

    • callback: function

      A callback function.

        • (source: S): R
        • Parameters

          • source: S

          Returns R

    Returns R

throughAsync

  • throughAsync<T, S, R>(source: S, callback: function): R

union

  • Creates a subquery for the set union of two Queryable objects.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • left: HierarchyIterable<TNode, T>

      A Queryable value.

    • right: Queryable<T>

      A Queryable value.

    • Optional equaler: Equaler<T>

      An [[Equaler]] object used to compare equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the set union of two Queryable objects.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode

    Parameters

    • left: Queryable<T>

      A Queryable value.

    • right: HierarchyIterable<TNode, T>

      A Queryable value.

    • Optional equaler: Equaler<T>

      An [[Equaler]] object used to compare equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the set union of two Queryable objects.

    category

    Subquery

    Type parameters

    • T

    Parameters

    • left: Queryable<T>

      A Queryable value.

    • right: Queryable<T>

      A Queryable value.

    • Optional equaler: Equaler<T>

      An [[Equaler]] object used to compare equality.

    Returns Iterable<T>

unionAsync

unionBy

  • Creates a subquery for the set union of two Queryable objects, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: HierarchyIterable<TNode, T>

      A Queryable value.

    • right: Queryable<T>

      A Queryable value.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the set union of two Queryable objects, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • left: Queryable<T>

      A Queryable value.

    • right: HierarchyIterable<TNode, T>

      A Queryable value.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns HierarchyIterable<TNode, T>

  • Creates a subquery for the set union of two Queryable objects, where set identity is determined by the selected key.

    category

    Subquery

    Type parameters

    • T
    • K

    Parameters

    • left: Queryable<T>

      A Queryable value.

    • right: Queryable<T>

      A Queryable value.

    • keySelector: function

      A callback used to select the key for each element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<T>

unionByAsync

Functions (Order)

orderBy

  • Creates an OrderedHierarchyIterable whose elements are sorted in ascending order by the provided key.

    category

    Order

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedHierarchyIterable<TNode, T>

  • Creates an OrderedIterable whose elements are sorted in ascending order by the provided key.

    category

    Order

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedIterable<T>

orderByAsync

orderByDescending

  • Creates an OrderedHierarchyIterable whose elements are sorted in descending order by the provided key.

    category

    Order

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedHierarchyIterable<TNode, T>

  • Creates an OrderedIterable whose elements are sorted in descending order by the provided key.

    category

    Order

    Type parameters

    • T
    • K

    Parameters

    • source: Queryable<T>

      A HierarchyIterable object.

    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedIterable<T>

orderByDescendingAsync

thenBy

  • Creates a subsequent OrderedHierarchyIterable whose elements are also sorted in ascending order by the provided key.

    category

    Order

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: OrderedHierarchyIterable<TNode, T>
    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedHierarchyIterable<TNode, T>

  • Creates a subsequent OrderedIterable whose elements are also sorted in ascending order by the provided key.

    category

    Order

    Type parameters

    • T
    • K

    Parameters

    • source: OrderedIterable<T>
    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedIterable<T>

thenByAsync

thenByDescending

  • Creates a subsequent OrderedHierarchyIterable whose elements are also sorted in descending order by the provided key.

    category

    Order

    Type parameters

    • TNode
    • T: TNode
    • K

    Parameters

    • source: OrderedHierarchyIterable<TNode, T>
    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedHierarchyIterable<TNode, T>

  • Creates a subsequent OrderedIterable whose elements are also sorted in descending order by the provided key.

    category

    Order

    Type parameters

    • T
    • K

    Parameters

    • source: OrderedIterable<T>
    • keySelector: function

      A callback used to select the key for an element.

        • (element: T): K
        • Parameters

          • element: T

          Returns K

    • Optional keyComparer: Comparison<K> | Comparer<K>

      An optional callback used to compare two keys.

    Returns OrderedIterable<T>

thenByDescendingAsync

Functions (Join)

fullJoin

  • fullJoin<O, I, K, R>(outer: Queryable<O>, inner: Queryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): Iterable<R>
  • Creates an [[Iterable]] for the correlated elements between an outer Queryable object and an inner Queryable object.

    category

    Join

    Type parameters

    • O
    • I
    • K
    • R

    Parameters

    • outer: Queryable<O>

      A Queryable object.

    • inner: Queryable<I>

      A Queryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in outer.

        • (element: O): K
        • Parameters

          • element: O

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in inner.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: O | undefined, inner: I | undefined): R
        • Parameters

          • outer: O | undefined
          • inner: I | undefined

          Returns R

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<R>

fullJoinAsync

  • Creates an [[AsyncIterable]] for the correlated elements between an outer AsyncQueryable object and an inner AsyncQueryable object.

    category

    Join

    Type parameters

    • O
    • I
    • K
    • R

    Parameters

    • outer: AsyncQueryable<O>

      An AsyncQueryable object.

    • inner: AsyncQueryable<I>

      An AsyncQueryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in outer.

        • (element: O): K
        • Parameters

          • element: O

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in inner.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: O | undefined, inner: I | undefined): R | PromiseLike<R>
        • Parameters

          • outer: O | undefined
          • inner: I | undefined

          Returns R | PromiseLike<R>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncIterable<R>

groupJoin

  • groupJoin<O, I, K, R>(outer: Queryable<O>, inner: Queryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): Iterable<R>
  • Creates a grouped [[Iterable]] for the correlated elements between an outer Queryable object and an inner Queryable object.

    category

    Join

    Type parameters

    • O
    • I
    • K
    • R

    Parameters

    • outer: Queryable<O>

      A Queryable object.

    • inner: Queryable<I>

      A Queryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in outer.

        • (element: O): K
        • Parameters

          • element: O

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in inner.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • Parameters

          Returns R

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<R>

groupJoinAsync

  • groupJoinAsync<O, I, K, R>(outer: AsyncQueryable<O>, inner: AsyncQueryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): AsyncIterable<R>
  • Creates a grouped [[AsyncIterable]] for the correlated elements between an outer AsyncQueryable object and an inner AsyncQueryable object.

    category

    Join

    Type parameters

    • O
    • I
    • K
    • R

    Parameters

    • outer: AsyncQueryable<O>

      An AsyncQueryable object.

    • inner: AsyncQueryable<I>

      An AsyncQueryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in outer.

        • (element: O): K
        • Parameters

          • element: O

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in inner.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: O, inner: Iterable<I>): R | PromiseLike<R>
        • Parameters

          Returns R | PromiseLike<R>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncIterable<R>

join

  • join<O, I, K, R>(outer: Queryable<O>, inner: Queryable<I>, outerKeySelector: function, innerKeySelector: function, resultSelector: function, keyEqualer?: Equaler<K>): Iterable<R>
  • Creates an [[Iterable]] for the correlated elements of two Queryable objects.

    category

    Join

    Type parameters

    • O
    • I
    • K
    • R

    Parameters

    • outer: Queryable<O>

      A Queryable object.

    • inner: Queryable<I>

      A Queryable object.

    • outerKeySelector: function

      A callback used to select the key for an element in outer.

        • (element: O): K
        • Parameters

          • element: O

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in inner.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: O, inner: I): R
        • Parameters

          • outer: O
          • inner: I

          Returns R

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns Iterable<R>

joinAsync

  • Creates an [[AsyncIterable]] for the correlated elements of two AsyncQueryable objects.

    category

    Join

    Type parameters

    • O
    • I
    • K
    • R

    Parameters

    • outer: AsyncQueryable<O>
    • inner: AsyncQueryable<I>
    • outerKeySelector: function

      A callback used to select the key for an element in outer.

        • (element: O): K
        • Parameters

          • element: O

          Returns K

    • innerKeySelector: function

      A callback used to select the key for an element in inner.

        • (element: I): K
        • Parameters

          • element: I

          Returns K

    • resultSelector: function

      A callback used to select the result for the correlated elements.

        • (outer: O, inner: I): R | PromiseLike<R>
        • Parameters

          • outer: O
          • inner: I

          Returns R | PromiseLike<R>

    • Optional keyEqualer: Equaler<K>

      An [[Equaler]] object used to compare key equality.

    Returns AsyncIterable<R>

zip

  • Creates a subquery that combines two Queryable objects by combining elements in tuples.

    category

    Join

    Type parameters

    • T
    • U

    Parameters

    Returns Iterable<[T, U]>

  • Creates a subquery that combines two Queryable objects by combining elements using the supplied callback.

    category

    Join

    Type parameters

    • T
    • U
    • R

    Parameters

    • left: Queryable<T>
    • right: Queryable<U>
    • selector: function

      A callback used to combine two elements.

        • (left: T, right: U): R
        • Parameters

          • left: T
          • right: U

          Returns R

    Returns Iterable<R>

zipAsync

Functions (Hierarchy)

ancestors

ancestorsAndSelf

ancestorsAndSelfAsync

ancestorsAsync

bottomMost

bottomMostAsync

children

childrenAsync

descendants

descendantsAndSelf

descendantsAndSelfAsync

descendantsAsync

hierarchy

hierarchyAsync

nthChild

nthChildAsync

parents

parentsAsync

root

rootAsync

self

selfAsync

siblings

siblingsAfterSelf

siblingsAfterSelfAsync

siblingsAndSelf

siblingsAndSelfAsync

siblingsAsync

siblingsBeforeSelf

siblingsBeforeSelfAsync

toHierarchy

toHierarchyAsync

topMost

  • Creates a HierarchyIterable for the top-most elements. Elements that are a descendant of any other element are removed.

    category

    Hierarchy

    Type parameters

    • TNode
    • T: TNode
    • U: T

    Parameters

    • source: HierarchyIterable<TNode, T>

      A HierarchyIterable object.

    • predicate: function

      An optional callback used to filter the results.

        • (value: T): boolean
        • Parameters

          • value: T

          Returns boolean

    Returns HierarchyIterable<TNode, U>

  • Creates a HierarchyIterable for the top-most elements. Elements that are a descendant of any other element are removed.

    category

    Hierarchy

    Type parameters

    • TNode
    • T: TNode

    Parameters

    Returns HierarchyIterable<TNode, T>

topMostAsync

Functions ()

F

  • F(): false

T

  • T(): true

compare

  • compare<T>(x: T, y: T): number
  • Compares two values.

    Type parameters

    • T

    Parameters

    • x: T
    • y: T

    Returns number

compose

  • compose<X, Y, Z>(g: function, f: function): function
  • Compose one function with another (i.e. compose(g, f) is x => g(f(x)))

    Type parameters

    • X
    • Y
    • Z

    Parameters

    • g: function
        • (y: Y): Z
        • Parameters

          • y: Y

          Returns Z

    • f: function
        • (x: X): Y
        • Parameters

          • x: X

          Returns Y

    Returns function

      • (x: X): Z
      • Parameters

        • x: X

        Returns Z

decrementer

  • decrementer(start?: number): (Anonymous function)
  • Creates a function that produces monotonically decreasing number values.

    Parameters

    • Default value start: number = 0

    Returns (Anonymous function)

equate

  • equate<T>(x: T, y: T): boolean
  • Equate two values.

    Type parameters

    • T

    Parameters

    • x: T
    • y: T

    Returns boolean

identity

  • identity<T>(value: T): T
  • A function that returns the provided value.

    Type parameters

    • T

    Parameters

    • value: T

    Returns T

incrementer

  • incrementer(start?: number): (Anonymous function)
  • Creates a function that produces monotonically increasing number values.

    Parameters

    • Default value start: number = 0

    Returns (Anonymous function)

lazy

  • lazy<T, A>(factory: function, ...args: A): Lazy<T>
  • Create a lazy-initialized value.

    Type parameters

    • T
    • A: any[]

    Parameters

    • factory: function
        • (...args: A): T
        • Parameters

          • Rest ...args: A

          Returns T

    • Rest ...args: A

    Returns Lazy<T>

noop

  • noop(...args: unknown[]): unknown
  • A function that does nothing.

    Parameters

    • Rest ...args: unknown[]

    Returns unknown

property

  • property<T, K>(key: K): function
  • property<K>(key: K): function
  • Creates a function that returns the property value for the provided key.

    Type parameters

    • T: object
    • K: keyof T

    Parameters

    • key: K

    Returns function

      • (value: T): T[K]
      • Parameters

        • value: T

        Returns T[K]

  • Creates a function that returns the property value for the provided key.

    Type parameters

    • K: PropertyKey

    Parameters

    • key: K

    Returns function

      • <T>(value: T): K extends keyof T ? T[K] : unknown
      • Type parameters

        • T: object

        Parameters

        • value: T

        Returns K extends keyof T ? T[K] : unknown

thunk

  • thunk<T>(value: T): function
  • Creates a function that always returns the provided value.

    Type parameters

    • T

    Parameters

    • value: T

    Returns function

      • (): T
      • Returns T

tuple

  • tuple<A>(...args: A): A
  • Makes a tuple from the provided arguments

    Type parameters

    • A: [any, Array]

    Parameters

    • Rest ...args: A

    Returns A

Generated using TypeDoc