Skip to content

assertTypeSymbol

Assert that a value is of type symbol, with type-narrowing.

import { assertTypeSymbol } from "@kensio/smartass";
const value: unknown = Symbol("id");
assertTypeSymbol(value);
// value is now narrowed to symbol

Source file: src/assert/type-symbol/type-symbol.assert.ts