mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +00:00
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:
parent
b93dabd670
commit
e0f789bc14
@ -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) => {
|
const invalidPair = _.find(_.toPairs(action.data), (pair) => {
|
||||||
return _.isObject(_.last(pair))
|
return _.isObject(_.last(pair))
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user