JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 19
  • Score
    100M100P100Q64470F
  • License MIT

Get all property keys of an object including non-enumerable and inherited ones

Package Exports

  • all-keys

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (all-keys) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

all-keys Build Status

Get all property keys of an object including non-enumerable and inherited ones

Like Reflect.ownKeys() but traverses up the prototype-chain.

Install

$ npm install all-keys

Usage

const allKeys = require('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__'
}
*/

API

allKeys(object, [options])

Returns a Set of all property names from object.

object

Type: Object

options

Type: Object

includeObjectPrototype

Type: boolean
Default: true

Include Object.prototype properties like isPrototypeOf.

includeSymbols

Type: boolean
Default: true

Include Symbol keys.

License

MIT © Sindre Sorhus