Skip to main content
The Deno 2 Release Candidate is 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/dependencies.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