Merge pull request #17922 from bcherny/master

[lodash] clean up _.sample typings
This commit is contained in:
Ryan Cavanaugh 2017-07-13 16:47:20 -07:00 committed by GitHub
commit 6ec2a092cc
2 changed files with 2 additions and 16 deletions

View File

@ -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;
}

View File

@ -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();