adds type safe data-last array every function
@@ -14,6 +14,15 @@ const arrayMap = <T, U>(mappingFunction: (param: T) => U): ((array: Array<T>) =>
const arrayFilter = <T>(filtrationFunction: (param: T) => boolean): ((array: Array<T>) => Array<T>) => (array = []) =>
array.filter(filtrationFunction);
+/**
+ * Typesafe utility `data last` function for array every
+ * @template T
+ * @param {(param: T) => boolean} filter
+ * @returns {((array: Array<T>) => boolean)}
+ */
+const arrayEvery = <T>(filter: (param: T) => boolean): ((array: Array<T>) => boolean) => (array = []) =>
+ array.every(filter);
+
/**
* Composable reducer abstraction, curries a reducing iteratee and returns a reducing function that takes a list
* @template U
@@ -42,4 +51,4 @@ const isListUnique = <T>(list: Array<T> = []): boolean => new Set(list).size ===
*/
const compact = <T>(list: Array<T> = []): Array<T> => list.filter(item => item);
-export { arrayMap, arrayFilter, arrayReduce, isListUnique, compact };
+export { arrayMap, arrayFilter, arrayReduce, isListUnique, compact, arrayEvery };
