- Preparing search index...
- The search index is not available
refa - v0.12.1
Function shortestAcceptingPath
- shortestAcceptingPath<S, T>(iter: FAIterator<S, Iterable<T>>, selectState: ((item: T) => S)): T[] | undefined
-
Parameters
-
iter: FAIterator<S, Iterable<T>>
-
selectState: ((item: T) => S)
Returns T[] | undefined
Returns any one of the shortest paths accepted by the given iterator.
E.g. for the regex
a|b|cd
, the returned path may bea
orb
but notcd
,If the iterator does not accept any path,
undefined
will be returned.