(input: unknown): input is symbolChecks whether a value is a symbol.
When to use
Use when you need a Predicate guard to narrow an unknown value to a
symbol.
Details
Uses typeof input === "symbol".
Example (Guarding symbols)
import { Predicate } from "effect"
const data: unknown = Symbol.for("id")
if (Predicate.isSymbol(data)) {
console.log(data.description)
}guardsisPropertyKey
Source effect/Predicate.ts:6693 lines
export function function isSymbol(
input: unknown
): input is symbol
Checks whether a value is a symbol.
When to use
Use when you need a Predicate guard to narrow an unknown value to a
symbol.
Details
Uses typeof input === "symbol".
Example (Guarding symbols)
import { Predicate } from "effect"
const data: unknown = Symbol.for("id")
if (Predicate.isSymbol(data)) {
console.log(data.description)
}
isSymbol(input: unknowninput: unknown): input: unknowninput is symbol {
return typeof input: unknowninput === "symbol"
}Referenced by 5 symbols