mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #6452 from chrootsu/lodash-random
lodash: signatures of the method _.random changed
This commit is contained in:
+24
-12
@@ -3178,20 +3178,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<number>;
|
||||
|
||||
result = _(1).chain().random();
|
||||
result = _(1).chain().random(2);
|
||||
result = _(1).chain().random(2, true);
|
||||
result = _(1).chain().random(true);
|
||||
result = _(true).chain().random();
|
||||
}
|
||||
}
|
||||
|
||||
/*********
|
||||
|
||||
Vendored
+15
@@ -7857,6 +7857,21 @@ declare module _ {
|
||||
random(floating?: boolean): number;
|
||||
}
|
||||
|
||||
interface LoDashExplicitWrapper<T> {
|
||||
/**
|
||||
* @see _.random
|
||||
*/
|
||||
random(
|
||||
max?: number,
|
||||
floating?: boolean
|
||||
): LoDashExplicitWrapper<number>;
|
||||
|
||||
/**
|
||||
* @see _.random
|
||||
*/
|
||||
random(floating?: boolean): LoDashExplicitWrapper<number>;
|
||||
}
|
||||
|
||||
/**********
|
||||
* Object *
|
||||
**********/
|
||||
|
||||
Reference in New Issue
Block a user