predictype / predicates/objects / objectState
objectState(
source
,oper
):boolean
Defined in: predicates/objects/objectState.ts:17
Checks state-related properties of an object (is_empty, is_not_empty, is_plain, is_frozen, is_sealed).
object
The object to check.
The state operation to perform.
boolean
True if the state check is valid according to the operator, otherwise false.
If the operation is not recognized.
objectState({}, 'is_empty'); // true
objectState({ a: 1 }, 'is_not_empty'); // true
objectState(Object.freeze({}), 'is_frozen'); // true