Skip to content

Commit 8dd538c

Browse files
committed
Re-introduce toString formatter
1 parent 946a4cd commit 8dd538c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/util.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ export const omitEmptyValues = (obj) => {
6868
}
6969

7070
// format keyframe styles to string
71-
export const toString = (keyframes) => {
71+
const defaultFormatter = (key, value) => `${key}:${value};`
72+
export const toString = (keyframes, formatter = defaultFormatter) => {
7273
return Object.keys(keyframes).reduce((outer, perc) => {
7374
const value = Object.keys(keyframes[perc]).reduce((inner, prop) => {
74-
return `${inner}${prop}:${keyframes[perc][prop]};`
75+
return `${inner}${formatter(prop, keyframes[perc][prop])}`
7576
}, '')
7677
return `${outer}${perc}{${value}}`
7778
}, '')

0 commit comments

Comments
 (0)