Check if a Value is an Object

A type-safe utility function to determine if a value is an object.

TypeScript
david

13 weeks ago

function isObject(value: unknown): value is Record<string, any> {
  return value !== null && typeof value === "object" && !Array.isArray(value);
}
0