(obj: any)
| 3 | * @returns True if the argument appears to be a plain object. |
| 4 | */ |
| 5 | export default function isPlainObject(obj: any): obj is object { |
| 6 | if (typeof obj !== 'object' || obj === null) return false |
| 7 | |
| 8 | let proto = obj |
| 9 | while (Object.getPrototypeOf(proto) !== null) { |
| 10 | proto = Object.getPrototypeOf(proto) |
| 11 | } |
| 12 | |
| 13 | return ( |
| 14 | Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null |
| 15 | ) |
| 16 | } |
no outgoing calls
no test coverage detected