From 734e2bb76c05e73f58f3aea296877c65ed8e40d0 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Mon, 26 Oct 2015 23:15:36 +0500 Subject: [PATCH] lodash: signatures of the method _.random changed --- lodash/lodash-tests.ts | 36 ++++++++++++++++++++++++------------ lodash/lodash.d.ts | 15 +++++++++++++++ 2 files changed, 39 insertions(+), 12 deletions(-) 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 * **********/