Skip to main content
Module

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

Being able to pattern match in typescript
Go to Latest
function recursive
import { recursive } from "https://deno.land/x/ts_matches@v5.2.0/src/parsers/recursive-parser.ts";

Must pass the shape that we expect since typescript as of this point can't infer with recursive functions like this.

Type Parameters

optional
B = never

Parameters

fn: EnsurredType<B>

This should be a function that takes a parser, basically the self in a type recursion, and return a parser that is the combination of the recursion.