predictype
Version:
PredicType is a library of pre-built and tested predicates for TypeScript, covering various data types and operations.
18 lines (17 loc) • 797 B
TypeScript
import { ObjectPrototypeRelationOper } from '../../enums/objects.js';
/**
* Checks prototype relation between objects (contains_prototype, is_prototype_of).
*
* @param source The object to check.
* @param oper The prototype operation to perform (e.g. 'is_prototype_of', 'prototype_is_null').
* @param proto The prototype to compare against.
* @returns True if the relation check is valid according to the operator, otherwise false.
*
* @throws {Error} If the operation is not recognized.
*
* @remarks
* Supported Operators:
* - **CONTAINS_PROTOTYPE**: Object's prototype is the given prototype
* - **IS_PROTOTYPE_OF**: Object is prototype of the given object
*/
export declare function objectPrototypeRelation(source: object, oper: ObjectPrototypeRelationOper, proto: any): boolean;