Skip to main content
Module

x/unknownutil/is.ts>isNull

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

Return true if the type of x is null.

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

const a: unknown = null;
if (is.Null(a)) {
  // a is narrowed to null
  const _: null = a;
}

Parameters

x: unknown

Returns

x is null