diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index abe109c6e..a38212fc0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4899,11 +4899,25 @@ module TestTemplate { } // _.trim -result = _.trim(); -result = _.trim(' abc '); -result = _.trim('-_-abc-_-', '_-'); -result = _('-_-abc-_-').trim(); -result = _('-_-abc-_-').trim('_-'); +module TestTrim { + { + let result: string; + + result = _.trim(); + result = _.trim(' abc '); + result = _.trim('-_-abc-_-', '_-'); + + result = _('-_-abc-_-').trim(); + result = _('-_-abc-_-').trim('_-'); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('-_-abc-_-').chain().trim(); + result = _('-_-abc-_-').chain().trim('_-'); + } +} // _.trimLeft module TestTrimLeft { diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 7f20d7aa8..11b14d6f3 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10459,11 +10459,15 @@ declare module _ { interface LoDashStatic { /** * Removes leading and trailing whitespace or specified characters from string. + * * @param string The string to trim. * @param chars The characters to trim. * @return Returns the trimmed string. */ - trim(string?: string, chars?: string): string; + trim( + string?: string, + chars?: string + ): string; } interface LoDashImplicitWrapper { @@ -10473,6 +10477,13 @@ declare module _ { trim(chars?: string): string; } + interface LoDashExplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): LoDashExplicitWrapper; + } + //_.trimLeft interface LoDashStatic { /**