From 8dd538c3cbc0e73e46a0af52f8836fdfb73f5836 Mon Sep 17 00:00:00 2001 From: Christoph Werner Date: Thu, 9 Feb 2017 00:04:04 +0100 Subject: [PATCH] Re-introduce toString formatter --- src/util.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/util.js b/src/util.js index c21b918..4f790e2 100644 --- a/src/util.js +++ b/src/util.js @@ -68,10 +68,11 @@ export const omitEmptyValues = (obj) => { } // format keyframe styles to string -export const toString = (keyframes) => { +const defaultFormatter = (key, value) => `${key}:${value};` +export const toString = (keyframes, formatter = defaultFormatter) => { return Object.keys(keyframes).reduce((outer, perc) => { const value = Object.keys(keyframes[perc]).reduce((inner, prop) => { - return `${inner}${prop}:${keyframes[perc][prop]};` + return `${inner}${formatter(prop, keyframes[perc][prop])}` }, '') return `${outer}${perc}{${value}}` }, '')