Skip to main content
Module

x/unknownutil/mod.ts>isSet

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

Return true if the type of x is Set<unknown>.

import { is } from "@core/unknownutil";

const a: unknown = new Set([0, 1, 2]);
if (is.Set(a)) {
  // a is narrowed to Set<unknown>
  const _: Set<unknown> = a;
}

Parameters

x: unknown

Returns

x is Set<unknown>