1 | export const camelize = text => {
|
2 | text = text.replace(/[-]+(.)?/g, (_, c) => c
|
3 | ? c.toUpperCase()
|
4 | : '')
|
5 | return text.substr(0, 1).toLowerCase() + text.substr(1)
|
6 | }
|
7 |
|
8 | export const mapToObjectNotation = props => {
|
9 | for (var prop in props)
|
10 | props[camelize(prop)] = props[prop]
|
11 | return props
|
12 | } |
\ | No newline at end of file |