(value: unknown)
| 30 | * |
| 31 | */ |
| 32 | export function getConstructor(value: unknown): Function | null | undefined { // eslint-disable-line ts/no-unsafe-function-type |
| 33 | // Object.getPrototypeOf require object in node.js |
| 34 | if (!isTypescriptObject(value)) { |
| 35 | return null |
| 36 | } |
| 37 | |
| 38 | return Object.getPrototypeOf(value)?.constructor |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Check if the value is an object even it created by `Object.create(null)` or more tricky way. |
no test coverage detected