Function getFirstConsumedChar

  • If a character is returned, it guaranteed to be a super set of the actual character. If the given element is always of zero length, then the empty character set will be returned.

    If exact is true then it is guaranteed that the returned character is guaranteed to be the actual character at all times if this element is not influenced by lookarounds outside itself.

    Partially consumed

    Only the given element and its children are processed. This is important when considering partially consumed first characters. The lookaround is derived only from the assertions inside the given element.

    E.g. In /b?a/, the result for b? is { char: 'b', empty: true, look: { char: all, edge: true } }. The lookaround accepts all characters because it doesn't take the a after b? into consideration.

    Parameters

    Returns FirstConsumedChar