openclaw/src/infra/plain-object.ts

12 lines
321 B
TypeScript

/**
* Strict plain-object guard (excludes arrays and host objects).
*/
export function isPlainObject(value: unknown): value is Record<string, unknown> {
return (
typeof value === "object" &&
value !== null &&
!Array.isArray(value) &&
Object.prototype.toString.call(value) === "[object Object]"
);
}