predictype / predicates/symbols / symbolState
symbolState(
source
,oper
):boolean
Defined in: predicates/symbols/symbolState.ts:24
Checks the state of a symbol (global or local) using the specified operation.
symbol
The symbol to check.
The state operation to perform (e.g. ‘is_global’, ‘is_local’).
boolean
True if the state check is valid according to the operator, otherwise false.
If the operation is not recognized.
const globalSym = Symbol.for('foo');
const localSym = Symbol('bar');
symbolState(globalSym, 'is_global'); // true
symbolState(localSym, 'is_local'); // true
Supported Operators: