Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/ts_matches/src/parsers/index.ts>Parser#refine

Being able to pattern match in typescript
Go to Latest
method Parser.prototype.refine
Re-export
import { Parser } from "https://deno.land/x/ts_matches@v5.2.1/src/parsers/index.ts";

We want to refine to a new type given an original type, like isEven, or casting to a more specific type

Type Parameters

optional
C = B

Parameters

refinementTest: (value: B) => value is B & C
optional
otherName: string = [UNSUPPORTED]