main
Last change
on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
368 bytes
|
Rev | Line | |
---|
[d565449] | 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 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.