Parserclass

new Parser<I, O>()
Return
Parser<I, O>
Base class for a parser that converts an input of type I into an output of type O.

Base class for a parser that converts an input of type I into an output of type O.

  • Subclasses implement parse() to define the actual transformation.
  • MarkupParser is the canonical implementation — it parses a markup string into a React node.

Examples

class UppercaseParser extends Parser<string, string> {
	parse(input: string): string { return input.toUpperCase(); }
}

Methods

Go

Parser.parse()method

Parse an input value into an output value.

parse(input: I): O