common-stuff
    Preparing search index...

    Function find

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • V

      Parameters

      • input: V[]
      • predicate: (value: V, index: number) => Promise<boolean>

      Returns Promise<undefined | V>

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • V
      • R

      Parameters

      • input: V[]
      • predicate: (value: V, index: number) => value is R

      Returns undefined | R

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • V

      Parameters

      • input: V[]
      • predicate: (value: V, index: number) => boolean

      Returns undefined | V

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • K
      • V

      Parameters

      • input: Map<K, V>
      • predicate: (value: [K, V], index: number) => Promise<boolean>

      Returns Promise<undefined | [K, V]>

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • K
      • V

      Parameters

      • input: Map<K, V>
      • predicate: (value: [K, V], index: number) => boolean

      Returns undefined | [K, V]

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • T

      Parameters

      • input: Set<T>
      • predicate: (value: T, index: number) => Promise<boolean>

      Returns Promise<undefined | T>

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • T
      • R

      Parameters

      • input: Set<T>
      • predicate: (value: T, index: number) => value is R

      Returns undefined | R

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • T

      Parameters

      • input: Set<T>
      • predicate: (value: T, index: number) => boolean

      Returns undefined | T

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • T

      Parameters

      • input: AsyncIterable<T>
      • predicate: (value: T, index: number) => boolean | Promise<boolean>

      Returns Promise<undefined | T>

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • T

      Parameters

      • input: Iterable<T>
      • predicate: (value: T, index: number) => Promise<boolean>

      Returns Promise<undefined | T>

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • T

      Parameters

      • input: Iterable<T>
      • predicate: (value: T, index: number) => boolean

      Returns undefined | T

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • input: Record<K, V>
      • predicate: (value: [K, V], index: number) => Promise<boolean>

      Returns Promise<undefined | [K, V]>

    • Returns the first element matching the predicate, or undefined if none match.

      Returns Promise when input is an AsyncIterable or the predicate returns a Promise. Sequential evaluation with short-circuit when the predicate is async.

      Type Parameters

      • K extends PropertyKey
      • V

      Parameters

      • input: Record<K, V>
      • predicate: (value: [K, V], index: number) => boolean

      Returns undefined | [K, V]