1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | var _camelCaseRegex = /([a-z])?([A-Z])/g;
|
7 |
|
8 | var _camelCaseReplacer = function _camelCaseReplacer(match, p1, p2) {
|
9 | return (p1 || '') + '-' + p2.toLowerCase();
|
10 | };
|
11 |
|
12 | var _camelCaseToDashCase = function _camelCaseToDashCase(s) {
|
13 | return s.replace(_camelCaseRegex, _camelCaseReplacer);
|
14 | };
|
15 |
|
16 | var camelCasePropsToDashCase = function camelCasePropsToDashCase(prefixedStyle) {
|
17 |
|
18 |
|
19 | return Object.keys(prefixedStyle).reduce(function (result, key) {
|
20 | var dashCaseKey = _camelCaseToDashCase(key);
|
21 |
|
22 |
|
23 | if (/^ms-/.test(dashCaseKey)) {
|
24 | dashCaseKey = '-' + dashCaseKey;
|
25 | }
|
26 |
|
27 | result[dashCaseKey] = prefixedStyle[key];
|
28 | return result;
|
29 | }, {});
|
30 | };
|
31 |
|
32 | exports.default = camelCasePropsToDashCase;
|
33 | module.exports = exports['default']; |
\ | No newline at end of file |