From 3885ba90e28db4b738daeea7e40675dc5dc3377a Mon Sep 17 00:00:00 2001 From: Jonah Meijers Date: Mon, 26 Oct 2020 20:50:04 +0100 Subject: [PATCH] refactor: Array.reduce -> ramda reduce --- src/helpers/pets.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/pets.ts b/src/helpers/pets.ts index 5b0cf57..f5e516e 100644 --- a/src/helpers/pets.ts +++ b/src/helpers/pets.ts @@ -1,4 +1,4 @@ -import { anyPass, clone, filter, isEmpty, length, pipe } from 'ramda' +import { anyPass, clone, filter, isEmpty, length, pipe, reduce } from 'ramda' import { validArrayIndex } from '../modules/arrayNumber' import { filterInvalidStringOccurenceTuples } from '../modules/occurenceTuple' import { arrayValueContainsString } from '../modules/stringArray' @@ -90,8 +90,8 @@ const isPetName = (str: string) => export const petReducer: ( initial: PetData -) => (arr: string[]) => PetData = initial => arr => - arr.reduce( +) => (arr: string[]) => PetData = initial => + reduce( (acc, curr) => returnFuncIfTrue(stringIsNumber(curr))( parsePetAmount,