Skip to main content
Module

x/unknownutil/is.ts>isSymbol

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

Return true if the type of x is symbol.

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

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

Parameters

x: unknown

Returns

x is symbol