From a394b7d613c247d459ed458411ef7353da303073 Mon Sep 17 00:00:00 2001 From: Michael Heasell Date: Fri, 1 Mar 2019 01:00:36 +0000 Subject: [PATCH] Annotate arrays correctly --- types/underscore/index.d.ts | 2 +- types/underscore/underscore-tests.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/types/underscore/index.d.ts b/types/underscore/index.d.ts index 3a3bcf7c9d..f7c73db4c0 100644 --- a/types/underscore/index.d.ts +++ b/types/underscore/index.d.ts @@ -560,7 +560,7 @@ declare module _ { pluck( list: _.List, - propertyName: string): any; + propertyName: string): any[]; /** * Returns the maximum value in list. diff --git a/types/underscore/underscore-tests.ts b/types/underscore/underscore-tests.ts index 4bf3eabe5c..6ef7fcb168 100644 --- a/types/underscore/underscore-tests.ts +++ b/types/underscore/underscore-tests.ts @@ -173,7 +173,7 @@ _.contains([1, 2, 3], 3, 1); _.invoke([[5, 1, 7], [3, 2, 1]], 'sort'); // https://github.com/DefinitelyTyped/DefinitelyTyped/issues/33479 -var foo: any = {'a': 1, 'b': 2}; +var foo: any[] = [{'a': 1, 'b': 2}]; _.pluck(foo, 'a'); var stooges = [{ name: 'moe', age: 40 }, { name: 'larry', age: 50 }, { name: 'curly', age: 60 }];