Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
function matches.guard
Re-export
import { matches } from "https://deno.land/x/embassyd_sdk@v0.3.3.0.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