diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index fc13fb0117..db394fde26 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3839,8 +3839,23 @@ result = _('08').parseInt(); result = _('08').parseInt(10); // _.repeat -result = _.repeat('*', 3); -result = _('*').repeat(3); +module TestRepeat { + { + let result: string; + result = _.repeat('*'); + result = _.repeat('*', 3); + + result = _('*').repeat(); + result = _('*').repeat(3); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _('*').chain().repeat(); + result = _('*').chain().repeat(3); + } +} // _.snakeCase result = _.snakeCase('Foo Bar'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 398f9a84fe..d9c019393f 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -9281,11 +9281,15 @@ declare module _ { interface LoDashStatic { /** * Repeats the given string n times. + * * @param string The string to repeat. * @param n The number of times to repeat the string. * @return Returns the repeated string. */ - repeat(string?: string, n?: number): string; + repeat( + string?: string, + n?: number + ): string; } interface LoDashImplicitWrapper { @@ -9295,6 +9299,13 @@ declare module _ { repeat(n?: number): string; } + interface LoDashExplicitWrapper { + /** + * @see _.repeat + */ + repeat(n?: number): LoDashExplicitWrapper; + } + //_.snakeCase interface LoDashStatic { /**