From 0db7ca6551be043ccf7302fa82bf101692dfadd9 Mon Sep 17 00:00:00 2001 From: Andrew <0coming.soon@gmail.com> Date: Tue, 26 Mar 2019 15:46:08 +0500 Subject: [PATCH] Allow to pass _.List to OOP wrapper --- types/underscore/index.d.ts | 1 + types/underscore/underscore-tests.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 209f660277..e3973187c8 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -105,6 +105,7 @@ declare module _ { * @param key First argument to Underscore object functions. **/ (value: _.Dictionary): Underscore; + (value: _.List): Underscore; (value: Array): Underscore; (value: T): Underscore; diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index bd5a871545..4396ce5c35 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -147,6 +147,10 @@ namespace TestFind { result = _('abc').chain().detect(iterator).value(); result = _('abc').chain().detect(iterator, context).value(); } + + { + _(list).map(x => x.a); + } } var evens = _.filter([1, 2, 3, 4, 5, 6], (num) => num % 2 == 0);