mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-30 05:27:00 +00:00
19 lines
510 B
JavaScript
19 lines
510 B
JavaScript
define(function() {
|
|
/**
|
|
* domToCSS takes a camelCase string and converts it to kebab-case
|
|
* e.g. boxSizing -> box-sizing
|
|
*
|
|
* @access private
|
|
* @function domToCSS
|
|
* @param {string} name - String name of camelCase prop we want to convert
|
|
* @returns {string} The kebab-case version of the supplied name
|
|
*/
|
|
function domToCSS(name) {
|
|
return name.replace(/([A-Z])/g, function(str, m1) {
|
|
return '-' + m1.toLowerCase();
|
|
}).replace(/^ms-/, '-ms-');
|
|
}
|
|
|
|
return domToCSS;
|
|
});
|