• Converts most objects that can be an Iterator into one. The supported inputs are:

    • An Iterator, will return the input as is/unchanged.
    • An Iterable, will return the input with it's Symbol.iterator property called. So this includes any object that has a Symbol.iterator property. Like Arrays, Strings, Maps, Sets, etc.
    • Any function with an optional sentinel argument, will return a FunctionIterator. This iterator will call the input func once per next() call and will stop once the value of sentinel (default: undefined) is returned from func.
    • Any other non-nullable object, will return an ObjectIterator that iterates over the input object's own properties deeply.

    Type Parameters

    • T

    Parameters

    Returns Iterator<T>

  • Type Parameters

    • TFunc extends ((...args: any[]) => any)
    • TSentinel = undefined

    Parameters

    Returns FunctionIterator<TFunc, TSentinel>

  • Parameters

    • object: Record<PropertyKey, any>

    Returns ObjectIterator<any>