class-ancestors
v1.0.1
Published
For a given class, returns an array with its parent class, the parent’s parent, and so on.
Downloads
9
Maintainers
Readme
class-ancestors
A Node.js module which returns an array containing the ancestors of a given class.
Installation
npm install class-ancestors --save
Usage
const getClassAncestors = require('class-ancestors')
class A {}
class B extends A {}
class C extends B {}
getClassAncestors(C) // [B, A]
getClassAncestors.names(C) // ['B', 'A']