mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 08:41:23 +00:00
refactor: share plain object guard across config and utils
This commit is contained in:
11
src/infra/plain-object.ts
Normal file
11
src/infra/plain-object.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* 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]"
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user