forgeplus-react/node_modules/dom-lib/es/utils/camelize.js

18 lines
361 B
JavaScript

var hyphenPattern = /-(.)/g;
/**
* Camelcases a hyphenated string, for example:
*
* > camelize('background-color')
* < "backgroundColor"
*
* @param {string} string
* @return {string}
*/
function camelize(string) {
return string.replace(hyphenPattern, function (_, character) {
return character.toUpperCase();
});
}
export default camelize;