mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Add _.upperCase and _.lowerCase.
This commit is contained in:
committed by
John-David Dalton
parent
7da4ea5ecb
commit
6725e7dc49
36
lodash.js
36
lodash.js
@@ -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 = {};
|
||||
|
||||
Reference in New Issue
Block a user