get-property-names v1.0.0
Non-
own
version ofObject.getOwnPropertyNames()
Install
npm install get-property-names
Usage
const getPropertyNames = const a = a: 1 b: 2 //=> this returns ['a', 'b'] {} {} //=> this returns `['constructor', 'bar', 'foo']` { super thisbaz = 1 } //=> this returns `['baz', 'constructor', 'foo']`
As the examples above, getPropertyNames
returns the list of all the property names of an object, which includes non enumerable properties in its prototype chain.
License
MIT