(instance: AribtraryObject | Constructor)
| 33 | } |
| 34 | |
| 35 | export function hierarchy(instance: AribtraryObject | Constructor): string[] { |
| 36 | const result = new Array<string>(); |
| 37 | let type = classOf(instance); |
| 38 | while (type) { |
| 39 | if (type.name) { |
| 40 | result.push(type.name); |
| 41 | } |
| 42 | type = parentClassOf(type); |
| 43 | } |
| 44 | return result; |
| 45 | } |
| 46 | |
| 47 | export function parentClassOf(instance: AribtraryObject | Constructor): Constructor | undefined { |
| 48 | if (is.nullish(instance)) { |
no test coverage detected