Defer unwrapping config until actually evaluating the config() function

This commit is contained in:
Adam Wathan 2017-11-26 14:53:30 -05:00
parent 74fc46adb7
commit df8d80fbbf

View File

@ -2,11 +2,10 @@ import _ from 'lodash'
import functions from 'postcss-functions'
export default function(config) {
const options = config()
return functions({
functions: {
config: (path, defaultValue) => {
const options = config()
return _.get(options, _.trim(path, `'"`), defaultValue)
},
},