diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2e7e31bbd..cc2c430bf 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -5142,11 +5142,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 43c1a6862..1870a4d47 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -10696,11 +10696,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 { @@ -10710,6 +10714,13 @@ declare module _ { trim(chars?: string): string; } + interface LoDashExplicitWrapper { + /** + * @see _.trim + */ + trim(chars?: string): LoDashExplicitWrapper; + } + //_.trimLeft interface LoDashStatic { /**