Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

object-keys

Package Overview
Dependencies
0
Maintainers
1
Versions
32
Issues
File Explorer

Advanced tools

object-keys

An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim

    1.1.1latest

Version published
Maintainers
1
Weekly downloads
24,277,074
decreased by-10.9%

Weekly downloads

Readme

Source

#object-keys Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

An Object.keys shim. Invoke its "shim" method to shim Object.keys if it is unavailable.

Most common usage:

var keys = Object.keys || require('object-keys');

Example

var keys = require('object-keys'); var assert = require('assert'); var obj = { a: true, b: true, c: true }; assert.deepEqual(keys(obj), ['a', 'b', 'c']); var keys = require('object-keys'); var assert = require('assert'); /* when Object.keys is not present */ delete Object.keys; var shimmedKeys = keys.shim(); assert.equal(shimmedKeys, keys); assert.deepEqual(Object.keys(obj), keys(obj)); var keys = require('object-keys'); var assert = require('assert'); /* when Object.keys is present */ var shimmedKeys = keys.shim(); assert.equal(shimmedKeys, Object.keys); assert.deepEqual(Object.keys(obj), keys(obj));

Source

Implementation taken directly from es5-shim, with modifications, including from lodash.

Tests

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

Keywords

FAQs

What is object-keys?

An Object.keys replacement, in case Object.keys is not available. From https://github.com/es-shims/es5-shim

Is object-keys popular?

The npm package object-keys receives a total of 18,740,529 weekly downloads. As such, object-keys popularity was classified as popular.

Is object-keys well maintained?

We found that object-keys demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 07 Apr 2019

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc