Don't mutate custom color palette when overriding per-plugin colors (#6546)
This commit is contained in:
parent
4a5ba3779e
commit
6cf3e3e55f
3 changed files with 66 additions and 2 deletions
|
|
@ -6,6 +6,8 @@ import colors from '../public/colors'
|
|||
import { defaults } from './defaults'
|
||||
import { toPath } from './toPath'
|
||||
import { normalizeConfig } from './normalizeConfig'
|
||||
import isPlainObject from './isPlainObject'
|
||||
import { cloneDeep } from './cloneDeep'
|
||||
|
||||
function isFunction(input) {
|
||||
return typeof input === 'function'
|
||||
|
|
@ -144,7 +146,15 @@ function resolveFunctionKeys(object) {
|
|||
val = isFunction(val) ? val(resolvePath, configUtils) : val
|
||||
}
|
||||
|
||||
return val === undefined ? defaultValue : val
|
||||
if (val === undefined) {
|
||||
return defaultValue
|
||||
}
|
||||
|
||||
if (isPlainObject(val)) {
|
||||
return cloneDeep(val)
|
||||
}
|
||||
|
||||
return val
|
||||
}
|
||||
|
||||
resolvePath.theme = resolvePath
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue