@lou.codes/predicates
Version:
🧐 Predicate util functions
19 lines (18 loc) • 608 B
TypeScript
import type { Class } from "@lou.codes/types";
/**
* Checks if given `input`'s prototype comes directly from given `constructor`.
*
* @category Predicates
* @category Objects
* @example
* ```typescript
* const isPrototypeOfObject = isPrototypeOf(Object);
* isPrototypeOfObject({}); // true
* isPrototypeOfObject(/./); // false
* ```
* @param constructor Constructor to check.
* @returns Returns a curried function with `constructor` in context.
*/
export declare const isPrototypeOf: <Constructor extends Class>(
constructor: Constructor,
) => <Input extends object>(object: Input) => boolean;