Function safeIter

  • Yield all values from an iterable but catch any error.

    Type Parameters

    • T

    Parameters

    • iterable: AnyIterable<T>

      Input iterable.

    • OptionalonError: ((err?: unknown) => void)

      Callback to receive errors thrown by the iterable.

        • (err?): void
        • Parameters

          • Optionalerr: unknown

          Returns void

    Returns AsyncIterableIterator<T>

    Iterable that does not throw errors.