From e0f789bc143d35a310ec9ce8f961bcadadf1b837 Mon Sep 17 00:00:00 2001 From: Benedict Aas Date: Thu, 15 Feb 2018 17:23:11 +0000 Subject: [PATCH] refactor: remove stale invalid key check in store (#2050) We remove a piece of code checking whether `_.keys` returns any non-string values in its array, but per the Lodash documentation `_.keys` always returns an array of strings. Change-Type: patch Changelog-Entry: Remove stale `invalidKey` check in store. --- lib/shared/store.js | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/shared/store.js b/lib/shared/store.js index 575e5f63..6883f466 100644 --- a/lib/shared/store.js +++ b/lib/shared/store.js @@ -458,16 +458,6 @@ const storeReducer = (state = DEFAULT_STATE, action) => { }) } - const invalidKey = _.find(_.keys(action.data), (key) => { - return !_.isString(key) - }) - - if (!_.isNil(invalidKey)) { - throw errors.createError({ - title: `Invalid setting key: ${invalidKey}` - }) - } - const invalidPair = _.find(_.toPairs(action.data), (pair) => { return _.isObject(_.last(pair)) })