predictype
Version:
PredicType is a library of pre-built and tested predicates for TypeScript, covering various data types and operations.
18 lines (17 loc) • 748 B
TypeScript
import { ObjectKeyMembershipOper } from '../../enums/objects.js';
/**
* Checks if a key is (or is not) in a list of possible keys using the specified operation.
*
* @param source The object to check.
* @param oper The membership operation to perform (e.g. 'key_in', 'key_not_in').
* @param keys The array of possible keys.
* @returns True if the membership check is valid according to the operator, otherwise false.
*
* @throws {Error} If the operation is not recognized or keys is missing.
*
* @remarks
* Supported Operators:
* - **IN**: At least one key is present
* - **NOT_IN**: No keys are present
*/
export declare function objectKeyMembership(source: object, oper: ObjectKeyMembershipOper, keys: (string | symbol)[]): boolean;