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

101

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

101 - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

4

find-index.js

@@ -17,3 +17,3 @@ /**

module.exports = function (list, predicate) {
if (list && list.length && !isFunction(list)) {
if (list && 'length' in list && !isFunction(list)) {
return findIndex(list, predicate);

@@ -33,3 +33,3 @@ }

function findIndex (list, predicate) {
if (!list || !list.length) {
if (!list || !('length' in list)) {
throw new TypeError('list must be have length property');

@@ -36,0 +36,0 @@ }

@@ -19,3 +19,3 @@ /**

var val;
if (exists(item && item.length) && !isFunction(item)) {
if (exists(item && ('length' in item)) && !isFunction(item)) {
val = item[item.length - 1];

@@ -22,0 +22,0 @@ }

{
"name": "101",
"version": "0.3.0",
"version": "0.3.1",
"description": "common javascript utils that can be required selectively that assume es5+",

@@ -5,0 +5,0 @@ "main": "index.js",

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

101
101 [![Build Status](https://travis-ci.org/tjmehta/101.svg?branch=master)](https://travis-ci.org/tjmehta/101)
===

@@ -3,0 +3,0 @@

@@ -40,2 +40,7 @@ var Lab = require('lab');

});
it('should return -1 in an empty list', function (done) {
var arr = [];
expect(findIndex(arr, function (v) { return v === 1; })).to.equal(-1);
done();
});
it('should get the index of an item in an array/string that passes a given function', function (done) {

@@ -88,2 +93,2 @@ var arr = this.arr;

});
});
});
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