Function shortestAcceptingPath

  • Returns any one of the shortest paths accepted by the given iterator.

    E.g. for the regex a|b|cd, the returned path may be a or b but not cd,

    If the iterator does not accept any path, undefined will be returned.

    Type Parameters

    • S

    • T

    Parameters

    • iter: FAIterator<S, Iterable<T>>
    • selectState: ((item: T) => S)
        • (item: T): S
        • Parameters

          • item: T

          Returns S

    Returns T[] | undefined