array.prototype.find
Advanced tools
Comparing version 0.1.1 to 1.0.0
{ | ||
"name": "array.prototype.find", | ||
"main": "index.js", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"homepage": "https://github.com/paulmillr/Array.prototype.find", | ||
"authors": [ | ||
"Paul Miller <http://paulmillr.com>" | ||
"Paul Miller <http://paulmillr.com>", | ||
"Duncan Hall <http://duncanhall.net>" | ||
], | ||
@@ -9,0 +10,0 @@ "description": "Array.prototype.find ES6 polyfill.", |
@@ -0,3 +1,10 @@ | ||
# 0.2.0 | ||
Add travis support | ||
Add tests | ||
Fix failing test: 'should work with an array-like object with negative length' | ||
# 0.1.1 | ||
check if array#find already exists |
@@ -5,3 +5,3 @@ { | ||
"description": "Array.prototype.find ES6 polyfill.", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"keywords": ["Array.prototype.find", "find", "es6", "ecmascript 6", "polyfill"], | ||
@@ -8,0 +8,0 @@ "dependencies": {}, |
// Array.prototype.find - MIT License (c) 2013 Paul Miller <http://paulmillr.com> | ||
// For all details and docs: https://github.com/paulmillr/array.prototype.find | ||
// Fixes and tests supplied by Duncan Hall <http://duncanhall.net> | ||
(function(globals){ | ||
@@ -8,9 +9,9 @@ if (Array.prototype.find) return; | ||
var list = Object(this); | ||
var length = list.length >>> 0; // ES.ToUint32; | ||
var length = list.length < 0 ? 0 : list.length >>> 0; // ES.ToUint32; | ||
if (length === 0) return undefined; | ||
if (typeof predicate !== 'function') { | ||
if (typeof predicate !== 'function' || Object.prototype.toString.call(predicate) !== '[object Function]') { | ||
throw new TypeError('Array#find: predicate must be a function'); | ||
} | ||
var thisArg = arguments[1]; | ||
for (var i = 0, value; i < length && i in list; i++) { | ||
for (var i = 0, value; i < length; i++) { | ||
value = list[i]; | ||
@@ -17,0 +18,0 @@ if (predicate.call(thisArg, value, i, list)) return value; |
{ | ||
"name": "array.prototype.find", | ||
"version": "0.1.1", | ||
"version": "1.0.0", | ||
"description": "Array.prototype.find ES6 polyfill.", | ||
"keywords": ["Array.prototype.find", "find", "es6", "ecmascript 6", "polyfill"], | ||
"keywords": [ | ||
"Array.prototype.find", | ||
"find", | ||
"es6", | ||
"ecmascript 6", | ||
"polyfill" | ||
], | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"test": "mocha tests/*.js" | ||
}, | ||
@@ -15,6 +21,16 @@ "repository": { | ||
"author": "Paul Miller <http://paulmillr.com>", | ||
"contributors": [ | ||
{ | ||
"name": "Duncan Hall", | ||
"email": "himself@duncanhall.net" | ||
} | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/paulmillr/Array.prototype.find/issues" | ||
}, | ||
"devDependencies": { | ||
"chai": "~1.9.1", | ||
"mocha": "~1.21.4" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
[![Build Status](https://travis-ci.org/duncanhall/Array.prototype.find.svg?branch=master)](https://travis-ci.org/duncanhall/Array.prototype.find) | ||
# ES6 `Array.prototype.find` polyfill | ||
@@ -41,2 +43,6 @@ | ||
## Acknowledgements | ||
Tests, fixes and travis support added by [_duncanhall](http://twitter.com/_duncanhall) | ||
## License | ||
@@ -43,0 +49,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
8773
9
137
1
70
2