From 02e000b53ea19fc234a615ebe526efa44cf2630f Mon Sep 17 00:00:00 2001 From: raeno Date: Wed, 5 Dec 2018 01:58:38 +0400 Subject: [PATCH] Use Array.reduce instead of lodash.reduce --- src/modules/errors.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/errors.js b/src/modules/errors.js index 25b5bd81e5..c809e1b5fb 100644 --- a/src/modules/errors.js +++ b/src/modules/errors.js @@ -1,8 +1,8 @@ -import {capitalize, reduce} from 'lodash' +import { capitalize } from 'lodash' export function humanizeErrors (errors) { - return reduce(errors, (errs, val, k) => { - let message = reduce(val, (acc, message) => { + return Object.entries(errors).reduce((errs, [k, val]) => { + let message = val.reduce((acc, message) => { let key = capitalize(k.replace(/_/g, ' ')) return acc + [key, message].join(' ') + '. ' }, '')