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.isA

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

This is a constructor helper that can use a predicate tester in the form of a guard function, and will return a parser that will only parse if the predicate returns true. https://www.typescriptlang.org/docs/handbook/advanced-types.html#type-guards-and-differentiating-types

Type Parameters

A
B extends A

Parameters

checkIsA: (value: A) => value is B
name: string