Skip to content

Commit 373891e

Browse files
committed
Refactor configToCss helper
1 parent bff517e commit 373891e

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/index.js

+5-7
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,12 @@ const computed = {
99
}
1010

1111
function configToCss(config) {
12-
return {
12+
return merge(
1313
...Object.keys(config)
14-
.filter((x) => computed[x])
15-
.reduce((acc, cur) => {
16-
return { ...acc, ...computed[cur](config[cur]) }
17-
}, {}),
18-
...merge(...castArray(config.css || {})),
19-
}
14+
.filter((key) => computed[key])
15+
.map((key) => computed[key](config[key])),
16+
...castArray(config.css || {})
17+
)
2018
}
2119

2220
module.exports = plugin.withOptions(

0 commit comments

Comments
 (0)