Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "101", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "common javascript utils that can be required selectively that assume es5+", | ||
@@ -34,3 +34,4 @@ "main": "index.js", | ||
"code": "^1.4.0", | ||
"lab": "^5.9.0" | ||
"lab": "^5.9.0", | ||
"sinon": "^1.17.1" | ||
}, | ||
@@ -37,0 +38,0 @@ "dependencies": { |
![101](http://i.imgur.com/MFrmMt6.png) | ||
=== | ||
[![NPM](https://nodei.co/npm/101.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/101/) | ||
[![NPM](https://nodei.co/npm/101.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/101/) | ||
[![Build Status](https://travis-ci.org/tjmehta/101.svg?branch=master)](https://travis-ci.org/tjmehta/101) | ||
[![Coverage Status](https://coveralls.io/repos/tjmehta/101/badge.png)](https://coveralls.io/r/tjmehta/101) | ||
[![Dependency Status](https://david-dm.org/tjmehta/101.svg)](https://david-dm.org/tjmehta/101) | ||
[![devDependency Status](https://david-dm.org/tjmehta/101/dev-status.svg)](https://david-dm.org/tjmehta/101#info=devDependencies) | ||
@@ -398,2 +401,27 @@ # Why another JS util library? | ||
## includes | ||
Polyfill of ES7 proposed Array.prototype.includes. Will default to Array.prototype.includes if | ||
present. | ||
```js | ||
var includes = require('101/includes'); | ||
var haystack = ['a', 'b', 'c', 'd', 'e']; | ||
includes(haystack, 'c'); // true | ||
// optional 3rd argument, searchFrom. Begin searching the target array from a specified index. | ||
includes(haystack, 'c', 3); // false | ||
includes(haystack, 'c', 0); // true | ||
// partial argument functionality | ||
var i = includes(haystack); | ||
i('c') // true | ||
i('g') // false | ||
// example composition usage: | ||
var not = require('101/not'); | ||
var notIn = not(includes); | ||
[1, 2, 3, 4, 5].filter(notIn([1, 2, 3])); // [4, 5] | ||
``` | ||
## indexBy | ||
@@ -400,0 +428,0 @@ Hashes an array of objects based on the value of a provided common key. |
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
57222
50
1210
807
3