Skip to main content
Go to Latest
function matches.guard
Re-export
import { matches } from "https://deno.land/x/embassyd_sdk@v0.3.1.1.4/mod.ts";
const { guard } = matches;

Create a custom type guard

Type Parameters

A
B extends A

Parameters

test: (value: A) => value is B

A function that will determine runtime if the value matches

optional
testName: string

A name for that function, useful when it fails

Returns

Parser<A, B>