Merge pull request #34222 from soon/underscore-oop-list

underscore: Allow to pass _.List<T> to OOP wrapper
This commit is contained in:
Benjamin Lichtman
2019-04-02 20:27:22 -07:00
committed by GitHub
2 changed files with 5 additions and 0 deletions
+1
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>;
+4
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);