Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

own-keys

ljharb0MIT1.0.1TypeScript support: included

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

own, key, keys, propertykey, string, symbol, enumerable, non-enumerable, robust

readme

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

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.0.1 - 2024-12-29

Commits

  • [Tests] sort with a proper comparator 4a65b56
  • [Fix] fix function name when Reflect.ownKeys is absent 5cf17cb

v1.0.0 - 2024-12-28

Commits

  • Initial implementation, tests, readme, types 870a06f
  • Initial commit 70323dc
  • npm init 4a3ad06
  • [Tests] node 0.8 sorts object keys differently b449364
  • Only apps should have lockfiles a54acbf