fix(colors): correctly flatten color closures

This commit is contained in:
Enzo Innocenzi 2020-08-18 22:35:10 +02:00
parent c16bf207bc
commit 0206d060e5
No known key found for this signature in database
GPG key ID: 142E4908E855E2B1

View file

@ -3,7 +3,7 @@ import _ from 'lodash'
export default function flattenColorPalette(colors) {
const result = _(colors)
.flatMap((color, name) => {
if (!_.isObject(color)) {
if (_.isFunction(color) || !_.isObject(color)) {
return [[name, color]]
}