is-what
Version:
JS type check (TypeScript supported) functions like `isPlainObject() isArray()` etc. A simple & small integration.
12 lines (11 loc) • 347 B
JavaScript
import { isAnyObject } from './isAnyObject.js';
/**
* Returns whether the payload is an object like a type passed in < >
*
* Usage: isObjectLike<{id: any}>(payload) // will make sure it's an object and has an `id` prop.
*
* @template T This must be passed in < >
*/
export function isObjectLike(payload) {
return isAnyObject(payload);
}