Allow to pass _.List<T> to OOP wrapper

This commit is contained in:
Andrew
2019-03-26 15:46:08 +05:00
committed by soon
parent 964c481dfd
commit 0db7ca6551
2 changed files with 5 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ declare module _ {
* @param key First argument to Underscore object functions.
**/
<T>(value: _.Dictionary<T>): Underscore<T>;
<T>(value: _.List<T>): Underscore<T>;
<T>(value: Array<T>): Underscore<T>;
<T>(value: T): Underscore<T>;

View File

@@ -147,6 +147,10 @@ namespace TestFind {
result = _('abc').chain().detect<string>(iterator).value();
result = _('abc').chain().detect<string>(iterator, context).value();
}
{
_(list).map(x => x.a);
}
}
var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);