array.partial
Advanced tools
Comparing version 1.0.4 to 1.0.5
'use strict' | ||
module.exports = function(arr, func) { | ||
const some = arr.filter(func) | ||
module.exports = function (arr, func) { | ||
var some = arr.filter(func) | ||
return some.length !== 0 && some.length !== arr.length | ||
} |
{ | ||
"name": "array.partial", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": | ||
@@ -5,0 +5,0 @@ "When you want array.some but not array.every. Useful when you need to determine partially selected states - like partially selecting tree nodes when some but not all child nodes are checked.", |
@@ -32,3 +32,3 @@ # array.partial [![Build Status](https://travis-ci.org/mrchief/array.partial.svg?branch=master)](https://travis-ci.org/mrchief/array.partial) | ||
const partial = require('array.partial') | ||
partial(array, callback) | ||
partial(array, predicate) | ||
``` | ||
@@ -38,3 +38,3 @@ | ||
### partial(array, callback) | ||
### partial(array, predicate) | ||
@@ -47,5 +47,5 @@ Return true if and only if some elements pass the check, otherwise false. | ||
#### callback | ||
#### predicate | ||
Type: `Function` - Function is a predicate, to test each element of the array. This is called with the following arguments: | ||
Type: `Function` - A predicate, to test each element of the array. This is called with the following arguments: | ||
@@ -52,0 +52,0 @@ `element` - The current element being processed in the array |
4600