Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/unknownutil/mod.ts>isOptional

🦕 A lightweight utility pack for handling unknown type
Latest
function isOptional
import { isOptional } from "https://deno.land/x/unknownutil@v3.18.1/mod.ts";

Return true if the type of predicate function x is annotated as Optional

Type Parameters

P extends Predicate<unknown>

Returns

x is P & WithMetadata<IsOptionalOfMetadata>