diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 8a47a41f12..c34c088e12 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -3157,20 +3157,32 @@ module TestInRange { // _.random module TestRandom { - let result: number; + { + let result: number; - result = _.random(); - result = _.random(1); - result = _.random(1, 2); - result = _.random(1, 2, true); - result = _.random(1, true); - result = _.random(true); + result = _.random(); + result = _.random(1); + result = _.random(1, 2); + result = _.random(1, 2, true); + result = _.random(1, true); + result = _.random(true); - result = _(1).random(); - result = _(1).random(2); - result = _(1).random(2, true); - result = _(1).random(true); - result = _(true).random(); + result = _(1).random(); + result = _(1).random(2); + result = _(1).random(2, true); + result = _(1).random(true); + result = _(true).random(); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(1).chain().random(); + result = _(1).chain().random(2); + result = _(1).chain().random(2, true); + result = _(1).chain().random(true); + result = _(true).chain().random(); + } } /********* diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 528356ff24..2cdb4820c6 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -7835,6 +7835,21 @@ declare module _ { random(floating?: boolean): number; } + interface LoDashExplicitWrapper { + /** + * @see _.random + */ + random( + max?: number, + floating?: boolean + ): LoDashExplicitWrapper; + + /** + * @see _.random + */ + random(floating?: boolean): LoDashExplicitWrapper; + } + /********** * Object * **********/