Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/async/bifurcate-by/docs/types/index.d"

Index

Type aliases

Binary

Binary: (error: Error | null, result: Array<Array<any>>) => void

Callback function.

param

encountered error or null

param

bifurcation result

Type declaration

    • (error: Error | null, result: Array<Array<any>>): void
    • Parameters

      • error: Error | null
      • result: Array<Array<any>>

      Returns void

BinaryPredicate

BinaryPredicate: (value: any, next: Callback) => void

Checks whether an element in a collection passes a test.

param

collection value

param

callback which should be called once the predicate function has finished processing a collection value

Type declaration

    • Parameters

      Returns void

Callback

Callback: Nullary | Unary | Binary

Callback function.

param

encountered error or null

param

bifurcation result

FactoryFunction

FactoryFunction: (collection: Collection, done: Callback) => void

Tests whether at least one element in a collection passes a test implemented by a predicate function, iterating from right to left.

param

input collection

param

function to invoke upon completion

Type declaration

Nullary

Nullary: () => void

Callback function.

Type declaration

    • (): void
    • Returns void

Predicate

Checks whether an element in a collection passes a test.

param

collection value

param

collection index

param

input collection

param

callback which should be called once the predicate function has finished processing a collection value

QuaternaryPredicate

QuaternaryPredicate: (value: any, index: number, collection: Collection, next: Callback) => void

Checks whether an element in a collection passes a test.

param

collection value

param

collection index

param

input collection

param

callback which should be called once the predicate function has finished processing a collection value

Type declaration

TernaryPredicate

TernaryPredicate: (value: any, index: number, next: Callback) => void

Checks whether an element in a collection passes a test.

param

collection value

param

collection index

param

callback which should be called once the predicate function has finished processing a collection value

Type declaration

    • (value: any, index: number, next: Callback): void
    • Parameters

      • value: any
      • index: number
      • next: Callback

      Returns void

Unary

Unary: (error: Error | null) => void

Callback function.

param

encountered error or null

Type declaration

    • (error: Error | null): void
    • Parameters

      • error: Error | null

      Returns void

Variables

Export assignment bifurcateByAsync

bifurcateByAsync: BifurcateByAsync

Splits values into two groups according to a predicate function.

Notes

  • This function does not guarantee that execution is asynchronous. To do so, wrap the done callback in a function which either executes at the end of the current stack (e.g., nextTick) or during a subsequent turn of the event loop (e.g., setImmediate, setTimeout).
param

input collection

param

function options

param

execution context

param

maximum number of pending invocations at any one time

param

boolean indicating whether to wait for a previous invocation to complete before invoking a provided function for the next element in a collection (default: false)

param

if values, values are returned; if indices, indices are returned; if *, both indices and values are returned (default: 'values')

param

predicate function specifying which group an element in the input collection belongs to

param

function to invoke upon completion

throws

must provide valid options