(value: unknown)
| 27 | * Returns true only for object-map values, excluding arrays and null. |
| 28 | */ |
| 29 | export function isPlainRecord(value: unknown): value is Record<string, unknown> { |
| 30 | if (typeof value !== 'object' || value === null || Array.isArray(value)) { |
| 31 | return false |
| 32 | } |
| 33 | |
| 34 | const prototype = Object.getPrototypeOf(value) |
| 35 | return prototype === Object.prototype || prototype === null |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Returns true for any non-null, non-array object — the LOOSE record check. |
no outgoing calls
no test coverage detected