predictype

predictype v0.8.1


predictype / predicates/objects/objectProperty / objectProperty

Function: objectProperty()

objectProperty(source, oper, key): boolean

Defined in: predicates/objects/objectProperty.ts:20

Checks if an object has or lacks a property (own or inherited) using the specified operation.

Parameters

source

object

The object to check.

oper

ObjectPropertyOper

The property operation to perform (e.g. ‘contains_property’, ‘lacks_own_property’).

key

The property key to check.

string symbol

Returns

boolean

True if the property check is valid according to the operator, otherwise false.

Throws

If the operation is not recognized.

Remarks

Supported Operators: