aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/camelCase.js
blob: dca86fc33b9fcb49556ce41e443beb62d2ec21fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// Matches dashed string for camelizing
var rdashAlpha = /-([a-z])/g;

// Used by camelCase as callback to replace()
function fcamelCase( _all, letter ) {
	return letter.toUpperCase();
}

// Convert dashed to camelCase
export function camelCase( string ) {
	return string.replace( rdashAlpha, fcamelCase );
}