Home > @wixc3/common > isObject
Checks if value is an object, e.g. a plain object, an array, a function, a regex, but not a primitive value.
Common usage scenario:
isObject(value) && value.foo === 'bar';
// Instead of:
typeof value === 'object' && value !== null && 'foo' in value && value.foo === 'bar';
Signature:
export declare function isObject(value: unknown): value is Readonly<Record<string | number | symbol, unknown>>;
Parameter | Type | Description |
---|---|---|
value | unknown |
Returns:
value is Readonly<Record<string | number | symbol, unknown>>