From 9dcd7c9635347703451587946ccf2e017a424745 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Thu, 5 Nov 2015 08:53:43 +0500 Subject: [PATCH] lodash: signatures of the method _.trimRight have been changed --- lodash/lodash-tests.ts | 25 ++++++++++++++++++++----- lodash/lodash.d.ts | 13 ++++++++++++- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index abe109c6e..7d1bf4bf8 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4927,11 +4927,26 @@ module TestTrimLeft { } // _.trimRight -result = _.trimRight(); -result = _.trimRight(' abc '); -result = _.trimRight('-_-abc-_-', '_-'); -result = _('-_-abc-_-').trimRight(); -result = _('-_-abc-_-').trimRight('_-'); + +module TestTrimRight { + { + let result: string; + + result = _.trimRight(); + result = _.trimRight(' abc '); + result = _.trimRight('-_-abc-_-', '_-'); + + result = _('-_-abc-_-').trimRight(); + result = _('-_-abc-_-').trimRight('_-'); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('-_-abc-_-').chain().trimRight(); + result = _('-_-abc-_-').chain().trimRight('_-'); + } +} // _.trunc module TestTrunc { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7f20d7aa8..bf821d22b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10506,11 +10506,15 @@ declare module _ { interface LoDashStatic { /** * Removes trailing whitespace or specified characters from string. + * * @param string The string to trim. * @param chars The characters to trim. * @return Returns the trimmed string. */ - trimRight(string?: string, chars?: string): string; + trimRight( + string?: string, + chars?: string + ): string; } interface LoDashImplicitWrapper { @@ -10520,6 +10524,13 @@ declare module _ { trimRight(chars?: string): string; } + interface LoDashExplicitWrapper { + /** + * @see _.trimRight + */ + trimRight(chars?: string): LoDashExplicitWrapper; + } + //_.trunc interface TruncOptions { /** The maximum string length. */