array.prototype.findindex
Advanced tools
Comparing version 0.1.1 to 1.0.0
{ | ||
"name": "Array.prototype.findIndex", | ||
"main": "index.js", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/paulmillr/Array.prototype.findIndex", | ||
@@ -6,0 +6,0 @@ "authors": [ |
@@ -5,3 +5,3 @@ { | ||
"description": "Array.prototype.findIndex ES6 polyfill.", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"keywords": ["Array.prototype.findIndex", "findIndex", "es6"], | ||
@@ -8,0 +8,0 @@ "dependencies": {}, |
10
index.js
// Array.prototype.findIndex - MIT License (c) 2013 Paul Miller <http://paulmillr.com> | ||
// For all details and docs: <https://github.com/paulmillr/Array.prototype.findIndex> | ||
(function(globals){ | ||
(function (globals) { | ||
if (Array.prototype.findIndex) return; | ||
@@ -8,9 +8,9 @@ | ||
var list = Object(this); | ||
var length = list.length >>> 0; // ES.ToUint32; | ||
var length = Math.max(0, list.length) >>> 0; // ES.ToUint32; | ||
if (length === 0) return -1; | ||
if (typeof predicate !== 'function') { | ||
if (typeof predicate !== 'function' || Object.prototype.toString.call(predicate) !== '[object Function]') { | ||
throw new TypeError('Array#findIndex: predicate must be a function'); | ||
} | ||
var thisArg = arguments.length > 1 ? arguments[1] : undefined; | ||
for (var i = 0; i < length && i in list; i++) { | ||
for (var i = 0; i < length; i++) { | ||
if (predicate.call(thisArg, list[i], i, list)) return i; | ||
@@ -32,2 +32,2 @@ } | ||
} | ||
})(this); | ||
}(this)); |
{ | ||
"name": "array.prototype.findindex", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Array.prototype.findIndex ES6 polyfill.", | ||
@@ -8,3 +8,3 @@ "keywords": ["Array.prototype.findIndex", "findIndex", "es6"], | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha test.js" | ||
}, | ||
@@ -19,3 +19,7 @@ "repository": { | ||
"url": "https://github.com/paulmillr/Array.prototype.findIndex/issues" | ||
}, | ||
"devDependencies": { | ||
"chai": "~1.9.1", | ||
"mocha": "~1.21.4" | ||
} | ||
} |
@@ -13,2 +13,3 @@ # ES6 `Array.prototype.findIndex` polyfill | ||
## Usage | ||
@@ -15,0 +16,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
7940
7
133
1
65
2