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