Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

object-keys

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

object-keys - npm Package Compare versions

Comparing version 0.1.8 to 0.2.0

2

package.json
{
"name": "object-keys",
"version": "0.1.8",
"version": "0.2.0",
"author": "Jordan Harband",

@@ -5,0 +5,0 @@ "description": "An Object.keys replacement, in case Object.keys is not available. From https://github.com/kriskowal/es5-shim",

@@ -21,3 +21,3 @@ (function () {

keysShim = function keys(object) {
if (!is.object(object)) {
if (!is.object(object) && !is.array(object)) {
throw new TypeError("Object.keys called on a non-object");

@@ -24,0 +24,0 @@ }

@@ -41,2 +41,10 @@ var test = require('tape');

t.test('works with an array', function (st) {
var arr = [1, 2, 3];
var theKeys = keys(arr);
st.equal(is.array(theKeys), true, 'returns an array');
st.deepEqual(theKeys, ['0', '1', '2'], 'Array has expected keys');
st.end();
});
t.test('returns names which are own properties', function (st) {

@@ -43,0 +51,0 @@ forEach(keys(obj), function (name) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc