Home > prsc > streamingOptional
Creates a StreamingParser that tries to apply the given parser optionally. It only yields the values produced by the inner parser if it matches successfully, and does not yield anything otherwise.
Signature:
export declare function streamingOptional<T>(parser: StreamingParser<T>): StreamingParser<T>;
Parameter | Type | Description |
---|---|---|
parser | StreamingParser<T> | StreamingParser to attempt to apply |
Returns: