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

array-entries

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-entries - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

21

array-entries.js

@@ -18,6 +18,17 @@ ;(function (exports) {

function NonEnumerable(obj) {
Object.keys(obj).forEach(function (key) {
Object.defineProperty(obj, key, {
value: obj[key],
writable: true,
enumerable: false
});
});
return obj;
}
function ArrayIterator(obj) {
this.iteratedObject = ToObject(obj);
this.index = 0;
this.kind = "key+value";
this.kind = 'key+value';
}

@@ -48,11 +59,11 @@

if (kind === "key") {
if (kind === 'key') {
return { value: index, done: false };
}
if (kind === "value") {
if (kind === 'value') {
return { value: object[index], done: false };
}
if (kind === "key+value") {
if (kind === 'key+value') {
return { value: [ index, object[index] ], done: false };

@@ -67,3 +78,3 @@ }

Array.prototype.entries = function entries() {
return new ArrayIterator(this);
return NonEnumerable(new ArrayIterator(this));
};

@@ -70,0 +81,0 @@ }

{
"name": "array-entries",
"version": "1.0.0",
"version": "1.1.0",
"description": "[].entries() polyfill.",

@@ -12,3 +12,3 @@ "main": "array-entries.js",

"cover": "istanbul cover tape -- test/*.js",
"lint": "jshint -c .jshintrc arra-entries.js"
"lint": "jshint -c .jshintrc array-entries.js"
},

@@ -15,0 +15,0 @@ "repository": {

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

Array.entries() polyfill
[].entries() polyfill
----
Per [this](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries) and
[this](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries)
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