(input: unknown)
| 3 | const isObjectLike = (value: unknown) => typeof value === 'object' && value !== null |
| 4 | |
| 5 | export function isObject<T = object>(input: unknown): input is T { |
| 6 | if (!isObjectLike(input) || Object.prototype.toString.call(input) !== '[object Object]') { |
| 7 | return false |
| 8 | } |
| 9 | if (Object.getPrototypeOf(input) === null) { |
| 10 | return true |
| 11 | } |
| 12 | let proto = input |
| 13 | while (Object.getPrototypeOf(proto) !== null) { |
| 14 | proto = Object.getPrototypeOf(proto) |
| 15 | } |
| 16 | return Object.getPrototypeOf(input) === proto |
| 17 | } |
| 18 | |
| 19 | export function isDisjoint(...headers: Array<object | undefined>) { |
| 20 | const sources = headers.filter(Boolean) as object[] |
no test coverage detected
searching dependent graphs…