1 |
|
2 | var space = require('to-space-case')
|
3 |
|
4 | /**
|
5 | * Export.
|
6 | */
|
7 |
|
8 | module.exports = toCamelCase
|
9 |
|
10 | /**
|
11 | * Convert a `string` to camel case.
|
12 | *
|
13 | * @param {String} string
|
14 | * @return {String}
|
15 | */
|
16 |
|
17 | function toCamelCase(string) {
|
18 | return space(string).replace(/\s(\w)/g, function (matches, letter) {
|
19 | return letter.toUpperCase()
|
20 | })
|
21 | }
|