Socket
Socket
Sign inDemoInstall

array.prototype.findindex

Package Overview
Dependencies
65
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

.eslintrc

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 2.0.1
- [Fix] use call instead of apply in bound entry point function (#17)
- [Refactor] Remove unnecessary double ToLength call (#16)
- [Tests] run tests on travis-ci
# 2.0.0

@@ -2,0 +7,0 @@ - [Breaking] use es-shim API (#13)

2

implementation.js

@@ -8,3 +8,3 @@ // Array.prototype.findIndex - MIT License (c) 2013 Paul Miller <http://paulmillr.com>

var list = ES.ToObject(this);
var length = ES.ToLength(ES.ToLength(list.length));
var length = ES.ToLength(list.length);
if (!ES.IsCallable(predicate)) {

@@ -11,0 +11,0 @@ throw new TypeError('Array#findIndex: predicate must be a function');

@@ -14,3 +14,4 @@ 'use strict';

ES.RequireObjectCoercible(array);
return implementation.apply(array, predicate);
var args = slice.call(arguments, 1);
return implementation.apply(array, args);
};

@@ -17,0 +18,0 @@

{
"name": "array.prototype.findindex",
"version": "2.0.0",
"version": "2.0.1",
"description": "Array.prototype.findIndex ES6 polyfill.",

@@ -12,3 +12,4 @@ "keywords": [

"scripts": {
"test": "es-shim-api --bound && mocha test.js"
"tests-only": "es-shim-api --bound && mocha test.js",
"test": "npm run tests-only"
},

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

@@ -22,13 +22,6 @@ # ES6 `Array.prototype.findIndex` polyfill

Node.js:
```javascript
require('array.prototype.findindex');
```
var findIndex = require('array.prototype.findindex');
Browser:
```javascript
// component(1)
require('array.prototype.findindex');
findIndex.shim(); // if you want to install it on the global environment
```

@@ -35,0 +28,0 @@

@@ -105,1 +105,19 @@ var expect = require("chai").expect;

});
describe('single function', function() {
var findIndexAsFunction = function(func) {
var args = Array.prototype.slice.call(arguments);
args.unshift(this);
return arrayFindIndex.apply(undefined, args);
};
describe('clean Object.prototype', function() {
runTests(findIndexAsFunction);
});
describe('polluted Object.prototype', function() {
Object.prototype[1] = 42;
runTests(findIndexAsFunction);
delete Object.prototype[1];
});
});
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc