From 27cb7c84ccd308f1d65e97643edd9a9fd40e71bd Mon Sep 17 00:00:00 2001 From: DomiR Date: Wed, 13 Jan 2016 19:09:18 +0100 Subject: [PATCH] (feature) Renamed _.trunc to _.truncate --- lodash/lodash-tests.ts | 34 +++++++++++++++++----------------- lodash/lodash.d.ts | 16 ++++++++-------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index d2ef64326..f8318107e 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -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; - 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': ' […]' }); } } diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index e88e628d7..f12d06ada 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -14174,8 +14174,8 @@ declare module _ { trimEnd(chars?: string): LoDashExplicitWrapper; } - //_.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 { /** - * @see _.trunc + * @see _.truncate */ - trunc(options?: TruncOptions|number): string; + truncate(options?: TruncateOptions|number): string; } interface LoDashExplicitWrapper { /** - * @see _.trunc + * @see _.truncate */ - trunc(options?: TruncOptions|number): LoDashExplicitWrapper; + truncate(options?: TruncateOptions|number): LoDashExplicitWrapper; } //_.unescape