Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ts_matches/src/parsers/recursive-parser.ts>RecursiveParser

Being able to pattern match in typescript
Go to Latest
class RecursiveParser
implements IParser<unknown, B>
import { RecursiveParser } from "https://deno.land/x/ts_matches@v5.2.0/src/parsers/recursive-parser.ts";

This parser is used when trying to create parsers that user their own definitions in their types, like interface Tree { [key: string]: Tree | Leaf; }

Constructors

new
private
RecursiveParser(recursive: (parser: Parser<unknown, any>) => Parser<unknown, unknown>, description?)

Properties

private
optional
parser: Parser<unknown, B>

Methods

parse<C, D>(a: unknown, onParse: OnParse<unknown, B, C, D>): C | D

Static Methods

create<B>(fn: (parser: Parser<unknown, any>) => Parser<unknown, unknown>): RecursiveParser<B>