Socket
Socket
Sign inDemoInstall

object.entries

Package Overview
Dependencies
66
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

1.0.2 / 2015-09-25
=================
* [Fix] Not-yet-visited keys deleted on a `[[Get]]` must not show up in the output (#1)
1.0.1 / 2015-09-21

@@ -2,0 +6,0 @@ =================

5

implementation.js

@@ -5,2 +5,3 @@ 'use strict';

var keys = require('object-keys');
var has = require('has');

@@ -12,5 +13,7 @@ module.exports = function entries(O) {

for (var i = 0; i < objKeys.length; ++i) {
entrys.push([objKeys[i], obj[objKeys[i]]]);
if (has(obj, objKeys[i])) {
entrys.push([objKeys[i], obj[objKeys[i]]]);
}
}
return entrys;
};
{
"name": "object.entries",
"version": "1.0.1",
"version": "1.0.2",
"author": "Jordan Harband",

@@ -39,2 +39,3 @@ "description": "ES7 spec-compliant Object.entries shim.",

"es-abstract": "^1.3.1",
"has": "^1.0.1",
"object-keys": "^1.0.7"

@@ -41,0 +42,0 @@ },

@@ -5,2 +5,3 @@ 'use strict';

var map = require('array-map');
var define = require('define-properties');

@@ -58,2 +59,14 @@ var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol';

});
t.test('not-yet-visited keys deleted on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) {
var o = { a: 1, b: 2, c: 3 };
Object.defineProperty(o, 'a', {
get: function () {
delete this.b;
return 1;
}
});
st.deepEqual(entries(o), [['a', 1], ['c', 3]], 'when "b" is deleted prior to being visited, it should not show up');
st.end();
});
};

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc