Skip to main content
Module

x/unknownutil/is.ts>isBoolean

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

Return true if the type of x is boolean.

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

const a: unknown = true;
if (is.Boolean(a)) {
  // a is narrowed to boolean
  const _: boolean = a;
}

Parameters

x: unknown

Returns

x is boolean