(feature) Renamed _.trunc to _.truncate

This commit is contained in:
DomiR
2016-01-23 14:39:10 +01:00
parent 63157c261e
commit 27cb7c84cc
2 changed files with 25 additions and 25 deletions
+17 -17
View File
@@ -9245,32 +9245,32 @@ module TestTrimEnd {
}
}
// _.trunc
module TestTrunc {
// _.truncate
module Testtruncate {
{
let result: string;
result = _.trunc('hi-diddly-ho there, neighborino');
result = _.trunc('hi-diddly-ho there, neighborino', 24);
result = _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
result = _.trunc('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
result = _.trunc('hi-diddly-ho there, neighborino', { 'omission': ' […]' });
result = _.truncate('hi-diddly-ho there, neighborino');
result = _.truncate('hi-diddly-ho there, neighborino', 24);
result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': ' ' });
result = _.truncate('hi-diddly-ho there, neighborino', { 'length': 24, 'separator': /,? +/ });
result = _.truncate('hi-diddly-ho there, neighborino', { 'omission': ' […]' });
result = _('hi-diddly-ho there, neighborino').trunc();
result = _('hi-diddly-ho there, neighborino').trunc(24);
result = _('hi-diddly-ho there, neighborino').trunc({ 'length': 24, 'separator': ' ' });
result = _('hi-diddly-ho there, neighborino').trunc({ 'length': 24, 'separator': /,? +/ });
result = _('hi-diddly-ho there, neighborino').trunc({ 'omission': ' […]' });
result = _('hi-diddly-ho there, neighborino').truncate();
result = _('hi-diddly-ho there, neighborino').truncate(24);
result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': ' ' });
result = _('hi-diddly-ho there, neighborino').truncate({ 'length': 24, 'separator': /,? +/ });
result = _('hi-diddly-ho there, neighborino').truncate({ 'omission': ' […]' });
}
{
let result: _.LoDashExplicitWrapper<string>;
result = _('hi-diddly-ho there, neighborino').chain().trunc();
result = _('hi-diddly-ho there, neighborino').chain().trunc(24);
result = _('hi-diddly-ho there, neighborino').chain().trunc({ 'length': 24, 'separator': ' ' });
result = _('hi-diddly-ho there, neighborino').chain().trunc({ 'length': 24, 'separator': /,? +/ });
result = _('hi-diddly-ho there, neighborino').chain().trunc({ 'omission': ' […]' });
result = _('hi-diddly-ho there, neighborino').chain().truncate();
result = _('hi-diddly-ho there, neighborino').chain().truncate(24);
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': ' ' });
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'length': 24, 'separator': /,? +/ });
result = _('hi-diddly-ho there, neighborino').chain().truncate({ 'omission': ' […]' });
}
}
+8 -8
View File
@@ -14174,8 +14174,8 @@ declare module _ {
trimEnd(chars?: string): LoDashExplicitWrapper<string>;
}
//_.trunc
interface TruncOptions {
//_.truncate
interface TruncateOptions {
/** The maximum string length. */
length?: number;
/** The string to indicate text is omitted. */
@@ -14193,24 +14193,24 @@ declare module _ {
* @param options The options object or maximum string length.
* @return Returns the truncated string.
*/
trunc(
truncate(
string?: string,
options?: TruncOptions|number
options?: TruncateOptions|number
): string;
}
interface LoDashImplicitWrapper<T> {
/**
* @see _.trunc
* @see _.truncate
*/
trunc(options?: TruncOptions|number): string;
truncate(options?: TruncateOptions|number): string;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.trunc
* @see _.truncate
*/
trunc(options?: TruncOptions|number): LoDashExplicitWrapper<string>;
truncate(options?: TruncateOptions|number): LoDashExplicitWrapper<string>;
}
//_.unescape