type R = IsSymbol<symbol> // true
type R = IsSymbol<never> // false
type R = IsSymbol<unknown> // false
type R = IsSymbol<symbol | number> // boolean
🔢 customize
Filter to ensure T
is symbol
, otherwise returns never
.
type R = IsSymbol<symbol, { selection: 'filter' }> // symbol
type R = IsSymbol<never, { selection: 'filter' }> // never
type R = IsSymbol<unknown, { selection: 'filter' }> // never
type R = IsSymbol<string | boolean, { selection: 'filter' }> // never
type R = IsSymbol<symbol | null> // symbol
🔢 customize:
Disable distribution of union types.
type R = IsSymbol<symbol | 1> // boolean
type R = IsSymbol<symbol | 1, { distributive: false }> // false
🔢 customize
Use unique branch identifiers to allow precise processing of the result.
🎭 predicate
Validate if
T
issymbol
.