hd-utils
Version:
A handy utils for modern JS developers
8 lines (7 loc) • 373 B
TypeScript
/**
* @description If the type of the value is a object, return true, otherwise return false. You can pass a function to check for a specific key inside the object
* @example isObject({}) //true
* @example isObject({}, (obj) => !!obj.name) //false
*/
declare const isObject: <T = {}>(val: unknown, predicate?: (val: T) => boolean) => val is T;
export default isObject;