@manuth/interceptor
Version:
Provides a convenient way to intercept method- property- and accessor-calls of an object.
24 lines (23 loc) • 564 B
TypeScript
/**
* Provides the functionality to check whether a key exists in an object.
*
* @template T
* The type of the target of the interception.
*
* @template TKey
* The key of the intercepted member.
*/
export type ExistenceChecker<T, TKey> =
/**
* Checks whether the specified {@linkcode key} exists.
*
* @param target
* The target this interception belongs to.
*
* @param key
* The key of the property.
*
* @returns
* A value indicating whether the specified {@linkcode key} exists in the {@linkcode target}.
*/
(target: T, key: TKey) => boolean;