1 | var DASH = /-([a-z])/g;
|
2 | var MS = /^Ms/g;
|
3 | var cache = {};
|
4 |
|
5 | function toUpper(match) {
|
6 | return match[1].toUpperCase();
|
7 | }
|
8 |
|
9 | export default function camelCaseProperty(property) {
|
10 | if (cache.hasOwnProperty(property)) {
|
11 | return cache[property];
|
12 | }
|
13 |
|
14 | var camelProp = property.replace(DASH, toUpper).replace(MS, 'ms');
|
15 | cache[property] = camelProp;
|
16 | return camelProp;
|
17 | } |
\ | No newline at end of file |