Rename _.truncate to _.trunc to align with ES6.

This commit is contained in:
John-David Dalton
2014-05-30 12:26:52 -04:00
parent 95db668c3c
commit f4a1573586
4 changed files with 25 additions and 25 deletions

View File

@@ -7937,22 +7937,22 @@
* @returns {string} Returns the truncated string.
* @example
*
* _.truncate('hi-diddly-ho there, neighborino');
* _.trunc('hi-diddly-ho there, neighborino');
* // => 'hi-diddly-ho there, neighbo...'
*
* _.truncate('hi-diddly-ho there, neighborino', 24);
* _.trunc('hi-diddly-ho there, neighborino', 24);
* // => 'hi-diddly-ho there, n...'
*
* _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
* _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
* // => 'hi-diddly-ho there,...'
*
* _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
* _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
* //=> 'hi-diddly-ho there...'
*
* _.truncate('hi-diddly-ho there, neighborino', { 'omission': ' [...]' });
* _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' [...]' });
* // => 'hi-diddly-ho there, neig [...]'
*/
function truncate(string, options) {
function trunc(string, options) {
var length = 30,
omission = '...';
@@ -8740,7 +8740,7 @@
lodash.trim = trim;
lodash.trimLeft = trimLeft;
lodash.trimRight = trimRight;
lodash.truncate = truncate;
lodash.trunc = trunc;
lodash.unescape = unescape;
lodash.uniqueId = uniqueId;