Add _.upperCase and _.lowerCase.

This commit is contained in:
Droogans
2015-10-05 15:28:08 -05:00
committed by John-David Dalton
parent 7da4ea5ecb
commit 6725e7dc49
2 changed files with 53 additions and 27 deletions

View File

@@ -11115,6 +11115,23 @@
return result + (index ? '-' : '') + word.toLowerCase();
});
/**
* Converts `string` to lower case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the lower cased string.
* @example
*
* _.lowerCase('FRED');
* // => 'fred'
*/
var lowerCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toLowerCase();
});
/**
* Pads `string` on the left and right sides if it's shorter than `length`.
* Padding characters are truncated if they can't be evenly divided by `length`.
@@ -11781,6 +11798,23 @@
: string;
}
/**
* Converts `string` to upper case.
*
* @static
* @memberOf _
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the upper cased string.
* @example
*
* _.upperCase('fred');
* // => 'FRED'
*/
var upperCase = createCompounder(function(result, word, index) {
return result + (index ? ' ' : '') + word.toUpperCase();
});
/**
* Splits `string` into an array of its words.
*
@@ -12811,6 +12845,7 @@
lodash.kebabCase = kebabCase;
lodash.last = last;
lodash.lastIndexOf = lastIndexOf;
lodash.lowerCase = lowerCase;
lodash.lt = lt;
lodash.lte = lte;
lodash.max = max;
@@ -12854,6 +12889,7 @@
lodash.trunc = trunc;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;
lodash.upperCase = upperCase;
mixin(lodash, (function() {
var source = {};