mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-01-30 05:27:30 +00:00
Merge pull request #17922 from bcherny/master
[lodash] clean up _.sample typings
This commit is contained in:
commit
6ec2a092cc
16
types/lodash/index.d.ts
vendored
16
types/lodash/index.d.ts
vendored
@ -9232,21 +9232,7 @@ declare namespace _ {
|
||||
* @return Returns the random element.
|
||||
*/
|
||||
sample<T>(
|
||||
collection: List<T>|Dictionary<T>|NumericDictionary<T> | null | undefined
|
||||
): T | undefined;
|
||||
|
||||
/**
|
||||
* @see _.sample
|
||||
*/
|
||||
sample<O extends Object, T>(
|
||||
collection: O | null | undefined
|
||||
): T | undefined;
|
||||
|
||||
/**
|
||||
* @see _.sample
|
||||
*/
|
||||
sample<T>(
|
||||
collection: Object | null | undefined
|
||||
collection: List<T> | Dictionary<T> | NumericDictionary<T> | object | null | undefined
|
||||
): T | undefined;
|
||||
}
|
||||
|
||||
|
||||
@ -5118,7 +5118,7 @@ namespace TestSample {
|
||||
result = _.sample(list);
|
||||
result = _.sample(dictionary);
|
||||
result = _.sample(numericDictionary);
|
||||
result = _.sample<{a: string}, string>({a: 'foo'});
|
||||
result = _.sample({a: 'foo'});
|
||||
result = _.sample<string>({a: 'foo'});
|
||||
|
||||
result = _('abc').sample();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user