Function: isPlainObject()
ts
function isPlainObject(value): value is Record<PropertyKey, unknown>;Checks whether a value is a plain object created by {} or Object.create(null). 检查值是否为由 {} 或 Object.create(null) 创建的普通对象。
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to check / 要检查的值 |
Returns
value is Record<PropertyKey, unknown>
true when the value is a plain object / 值是普通对象时返回 true
Example
ts
isPlainObject({})
// => trueSince
1.2.0