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

x/ts_matches/src/parsers/index.ts>recursive

Being able to pattern match in typescript
Go to Latest
function recursive
Re-export
import { recursive } from "https://deno.land/x/ts_matches@v5.2.0/src/parsers/index.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.