npm.io
0.1.3 • Published 11 years ago

getallpropertynames

Licence
MIT
Version
0.1.3
Deps
0
Vulns
0
Weekly
0

getAllPropertyNames

Get all property names along the prototype chain

Travis NPM

Install

npm install getallpropertynames --save

Usage

import getAllPropertyNames from 'getallpropertynames';


class Foo {
    foo() {}
}

class Bar extends Foo {
    bar() {}
}

let bar = new Bar();

getAllPropertyNames(bar); 
// ['constructor', 'bar', 'foo', 'toString', 'toLocaleString', 
// 'valueOf', 'hasOwnProperty', 'isPrototypeOf', ... ]

Keywords