predictype

predictype v0.8.1


predictype / predicates/objects/objectPrototypeRelation / objectPrototypeRelation

Function: objectPrototypeRelation()

objectPrototypeRelation(source, oper, proto): boolean

Defined in: predicates/objects/objectPrototypeRelation.ts:18

Checks prototype relation between objects (contains_prototype, is_prototype_of).

Parameters

source

object

The object to check.

oper

ObjectPrototypeRelationOper

The prototype operation to perform (e.g. ‘is_prototype_of’, ‘prototype_is_null’).

proto

any

The prototype to compare against.

Returns

boolean

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

Throws

If the operation is not recognized.

Remarks

Supported Operators: