Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* convert between different cases all the time.
*
* @flow
*/
import createStaticPrefixer from 'inline-style-prefixer/static/createPrefixer';
import createDynamicPrefixer from 'inline-style-prefixer/dynamic/createPrefixer';
import ExecutionEnvironment from 'exenv';
import staticData from './prefix-data/static';
import dynamicData from './prefix-data/dynamic';
import {camelCaseToDashCase} from './camel-case-props-to-dash-case';
const prefixAll: (style: Object) => Object = createStaticPrefixer(staticData);
const InlineStylePrefixer = createDynamicPrefixer(dynamicData, prefixAll);
function transformValues(style) {
return Object.keys(style).reduce((newStyle, key) => {
let value = style[key];
if (Array.isArray(value)) {
value = value.join(';' + key + ':');
} else if (
value &&
typeof value === 'object' &&
typeof value.toString === 'function'
) {
value = value.toString();
}
newStyle[key] = value;
return newStyle;