๐Ÿ“ฆ ljharb / own-keys

Robustly get an object's own property keys (strings and symbols), including non-enumerables when possible.

โ˜… 1 stars โ‘‚ 1 forks ๐Ÿ‘ 1 watching โš–๏ธ MIT License
๐Ÿ“ฅ Clone https://github.com/ljharb/own-keys.git
HTTPS git clone https://github.com/ljharb/own-keys.git
SSH git clone git@github.com:ljharb/own-keys.git
CLI gh repo clone ljharb/own-keys
Jordan Harband Jordan Harband [readme] replace runkit CI badge with shields.io check-runs badge 5caf6ed 7 days ago ๐Ÿ“ History
๐Ÿ“‚ main View all commits โ†’
๐Ÿ“ .github
๐Ÿ“ test
๐Ÿ“„ .eslintrc
๐Ÿ“„ .gitignore
๐Ÿ“„ .npmrc
๐Ÿ“„ .nycrc
๐Ÿ“„ CHANGELOG.md
๐Ÿ“„ index.d.ts
๐Ÿ“„ index.js
๐Ÿ“„ LICENSE
๐Ÿ“„ package.json
๐Ÿ“„ README.md
๐Ÿ“„ tsconfig.json
๐Ÿ“„ README.md

own-keys Version Badge

github actions coverage License Downloads

npm badge

Robustly get an object's own property keys (strings and symbols), including non-enumerables when possible.

Getting started

npm install --save own-keys

Usage/Examples

var ownKeys = require('own-keys');
var assert = require('assert');

assert.deepEqual(ownKeys({ a: 1, b: 2 }), ['a', 'b']);
assert.deepEqual(ownKeys([1, 2, 3]), [0, 1, 2, 'length']);

Tests

Simply clone the repo, npm install, and run npm test