Get all property keys of an object including non-enumerable and inherited ones
Like Reflect.ownKeys()
but traverses up the prototype-chain.
$ npm install all-keys
import allKeys from 'all-keys';
Object.getOwnPropertyNames(Symbol.prototype);
/*
[
'constructor',
'toString',
'valueOf'
]
*/
allKeys(Symbol.prototype);
/*
Set {
'constructor',
'toString',
'valueOf',
'toLocaleString',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'__defineGetter__',
'__lookupGetter__',
'__defineSetter__',
'__lookupSetter__',
'__proto__'
}
*/
Returns a Set
of all property names from object
.
Type: object
Type: object
Type: boolean
Default: true
Include Object.prototype
properties like isPrototypeOf
.
Type: boolean
Default: true
Include Symbol
keys.