@szilanor/stream
    Preparing search index...

    Function ofTypeAsync

    • Returns an AsyncOperationFunction that yields and casts only entries of the source Iterable that satisfy the given type-guard function.

      Type Parameters

      • T

        The type of the elements in the source Iterable.

      • TOfType = T

        The type of the elements in the result Iterable.

      Parameters

      Returns AsyncOperationFunction<T, TOfType>

      An AsyncOperationFunction that yields and casts only entries of the source Iterable that satisfy the given type-guard function.

      const result = ofTypeAsync<number, number>([1, 2, null, undefined, 3]);
      console.log(result); // [1, 2, 3]