Comparing version 0.3.1 to 0.3.2
@@ -6,2 +6,3 @@ /** | ||
var isFunction = require('./is-function'); | ||
var exists = require('./exists'); | ||
var isArray = Array.isArray; | ||
@@ -18,3 +19,3 @@ | ||
module.exports = function (list, predicate) { | ||
if (list && 'length' in list && !isFunction(list)) { | ||
if (exists(list && list.length) && !isFunction(list)) { | ||
return findIndex(list, predicate); | ||
@@ -34,3 +35,3 @@ } | ||
function findIndex (list, predicate) { | ||
if (!list || !('length' in list)) { | ||
if (!exists(list && list.length)) { | ||
throw new TypeError('list must be have length property'); | ||
@@ -37,0 +38,0 @@ } |
@@ -19,3 +19,3 @@ /** | ||
var val; | ||
if (exists(item && ('length' in item)) && !isFunction(item)) { | ||
if (exists(item && item.length) && !isFunction(item)) { | ||
val = item[item.length - 1]; | ||
@@ -22,0 +22,0 @@ } |
{ | ||
"name": "101", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "common javascript utils that can be required selectively that assume es5+", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
44261
1288