From 5fb2a9fe67a2b50f1c928e05351b02abcd54b098 Mon Sep 17 00:00:00 2001 From: Felipe Barriga Richards Date: Mon, 17 Aug 2015 15:21:37 -0300 Subject: [PATCH] lodash: fix pull, remove, fill, pluck --- lodash/lodash-tests.ts | 1 + lodash/lodash.d.ts | 62 +++++++++++++++++++++--------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2cbec68537..34080d18d0 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -639,6 +639,7 @@ result = _(stoogesAgesDict).sum('age'); result = _.pluck(stoogesAges, 'name'); result = _(stoogesAges).pluck('name').value(); +result = _.pluck(stoogesAges, ['name']); // _.partition result = _.partition('abcd', (n) => n < 'c'); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index c088f54596..97c02f4b4b 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1092,16 +1092,16 @@ declare module _ { * @param values The values to remove. * @return array. **/ - pull( - array: Array, - ...values: any[]): any[]; + pull( + array: Array, + ...values: T[]): T[]; /** * @see _.pull **/ - pull( - array: List, - ...values: any[]): any[]; + pull( + array: List, + ...values: T[]): T[]; } interface LoDashStatic { @@ -1141,50 +1141,50 @@ declare module _ { * @param thisArg The this binding of callback. * @return A new array of removed elements. **/ - remove( - array: Array, - callback?: ListIterator, - thisArg?: any): any[]; + remove( + array: Array, + callback?: ListIterator, + thisArg?: any): T[]; /** * @see _.remove **/ - remove( - array: List, - callback?: ListIterator, - thisArg?: any): any[]; + remove( + array: List, + callback?: ListIterator, + thisArg?: any): T[]; /** * @see _.remove * @param pluckValue _.pluck style callback **/ - remove( - array: Array, - pluckValue?: string): any[]; + remove( + array: Array, + pluckValue?: string): T[]; /** * @see _.remove * @param pluckValue _.pluck style callback **/ - remove( - array: List, - pluckValue?: string): any[]; + remove( + array: List, + pluckValue?: string): T[]; /** * @see _.remove * @param whereValue _.where style callback **/ - remove( - array: Array, - wherealue?: Dictionary): any[]; + remove( + array: Array, + wherealue?: Dictionary): T[]; /** * @see _.remove * @param whereValue _.where style callback **/ - remove( - array: List, - wherealue?: Dictionary): any[]; + remove( + array: List, + wherealue?: Dictionary): T[]; /** * @see _.remove @@ -2494,7 +2494,7 @@ declare module _ { * @see _.fill */ fill( - value: any, + value: TResult, start?: number, end?: number): LoDashArrayWrapper; } @@ -2504,7 +2504,7 @@ declare module _ { * @see _.fill */ fill( - value: any, + value: TResult, start?: number, end?: number): LoDashObjectWrapper>; } @@ -4069,21 +4069,21 @@ declare module _ { **/ pluck( collection: Array, - property: string): any[]; + property: string|string[]): any[]; /** * @see _.pluck **/ pluck( collection: List, - property: string): any[]; + property: string|string[]): any[]; /** * @see _.pluck **/ pluck( collection: Dictionary, - property: string): any[]; + property: string|string[]): any[]; } interface LoDashArrayWrapper {