Unverified Commit dbce4b02 authored by Robert Knight's avatar Robert Knight Committed by GitHub

Merge pull request #1898 from hypothesis/remove-unused-array-util

Remove unused array utility function
parents 0a44e65b 7117b033
......@@ -10,25 +10,6 @@ export function countIf(ary, predicate) {
}, 0);
}
/**
* Create a new array with the result of calling `mapFn` on every element in
* `ary`.
*
* Only truthy values are included in the resulting array.
*
* @param {Array} ary
* @param {Function} mapFn
*/
export function filterMap(ary, mapFn) {
return ary.reduce(function(newArray, item) {
const mapped = mapFn(item);
if (mapped) {
newArray.push(mapped);
}
return newArray;
}, []);
}
/**
* Convert an array to a set represented as an object.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment