33013357db46f1f444d934f010e1c08169b12b3c
[yaffs-website] / node_modules / grunt-legacy-log-utils / node_modules / lodash / startCase.js
1 var capitalize = require('./capitalize'),
2     createCompounder = require('./_createCompounder');
3
4 /**
5  * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
6  *
7  * @static
8  * @memberOf _
9  * @category String
10  * @param {string} [string=''] The string to convert.
11  * @returns {string} Returns the start cased string.
12  * @example
13  *
14  * _.startCase('--foo-bar');
15  * // => 'Foo Bar'
16  *
17  * _.startCase('fooBar');
18  * // => 'Foo Bar'
19  *
20  * _.startCase('__foo_bar__');
21  * // => 'Foo Bar'
22  */
23 var startCase = createCompounder(function(result, word, index) {
24   return result + (index ? ' ' : '') + capitalize(word);
25 });
26
27 module.exports = startCase;