mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 10:17:48 +00:00
Rename _.truncate to _.trunc to align with ES6.
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user