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.
This commit is contained in:
Benedict Aas 2018-02-15 17:23:11 +00:00 committed by GitHub
parent b93dabd670
commit e0f789bc14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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))
})