Skip to main content
Module

x/unknownutil/is.ts>isUnknown

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

Assume x is unknown and always return true regardless of the type of x.

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

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

Parameters

_x: unknown

Returns

_x is unknown