From 5dd9ae353ce862612130c1e856d933e5da0b3133 Mon Sep 17 00:00:00 2001 From: DomiR Date: Wed, 13 Jan 2016 23:21:24 +0100 Subject: [PATCH] (feature) Removed aliase _.select --- lodash/lodash-tests.ts | 98 ------------------------- lodash/lodash.d.ts | 163 +---------------------------------------- 2 files changed, 2 insertions(+), 259 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index ed873436a..d94e7a368 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -4778,104 +4778,6 @@ result = _.sampleSize([1, 2, 3, 4], 2); result = <_.LoDashImplicitArrayWrapper>_([1, 2, 3, 4]).sampleSize(2); result = _([1, 2, 3, 4]).sampleSize(2).value(); -// _.select -module TestSelect { - let array: TResult[]; - let list: _.List; - let dictionary: _.Dictionary; - - let stringIterator: (char: string, index: number, string: string) => any; - let listIterator: (value: TResult, index: number, collection: _.List) => any; - let dictionaryIterator: (value: TResult, key: string, collection: _.Dictionary) => any; - - { - let result: string[]; - - result = _.select('', stringIterator); - result = _.select('', stringIterator, any); - } - - { - let result: TResult[]; - - result = _.select(array, listIterator); - result = _.select(array, listIterator, any); - result = _.select(array, ''); - result = _.select(array, '', any); - result = _.select<{a: number}, TResult>(array, {a: 42}); - - result = _.select(list, listIterator); - result = _.select(list, listIterator, any); - result = _.select(list, ''); - result = _.select(list, '', any); - result = _.select<{a: number}, TResult>(list, {a: 42}); - - result = _.select(dictionary, dictionaryIterator); - result = _.select(dictionary, dictionaryIterator, any); - result = _.select(dictionary, ''); - result = _.select(dictionary, '', any); - result = _.select<{a: number}, TResult>(dictionary, {a: 42}); - } - - { - let result: _.LoDashImplicitArrayWrapper; - - result = _('').select(stringIterator); - result = _('').select(stringIterator, any); - } - - { - let result: _.LoDashImplicitArrayWrapper; - - result = _(array).select(listIterator); - result = _(array).select(listIterator, any); - result = _(array).select(''); - result = _(array).select('', any); - result = _(array).select<{a: number}>({a: 42}); - - result = _(list).select(listIterator); - result = _(list).select(listIterator, any); - result = _(list).select(''); - result = _(list).select('', any); - result = _(list).select<{a: number}, TResult>({a: 42}); - - result = _(dictionary).select(dictionaryIterator); - result = _(dictionary).select(dictionaryIterator, any); - result = _(dictionary).select(''); - result = _(dictionary).select('', any); - result = _(dictionary).select<{a: number}, TResult>({a: 42}); - } - - { - let result: _.LoDashExplicitArrayWrapper; - - result = _('').chain().select(stringIterator); - result = _('').chain().select(stringIterator, any); - } - - { - let result: _.LoDashExplicitArrayWrapper; - - result = _(array).chain().select(listIterator); - result = _(array).chain().select(listIterator, any); - result = _(array).chain().select(''); - result = _(array).chain().select('', any); - result = _(array).chain().select<{a: number}>({a: 42}); - - result = _(list).chain().select(listIterator); - result = _(list).chain().select(listIterator, any); - result = _(list).chain().select(''); - result = _(list).chain().select('', any); - result = _(list).chain().select<{a: number}, TResult>({a: 42}); - - result = _(dictionary).chain().select(dictionaryIterator); - result = _(dictionary).chain().select(dictionaryIterator, any); - result = _(dictionary).chain().select(''); - result = _(dictionary).chain().select('', any); - result = _(dictionary).chain().select<{a: number}, TResult>({a: 42}); - } -} - // _.shuffle module TestShuffle { let array: TResult[]; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 103897a2b..e59f5a89e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -171,8 +171,8 @@ Removed 17 aliases - [ ] Removed aliase _.inject - [ ] Removed aliase _.methods - [ ] Removed aliase _.object -- [ ] Removed aliase _.#run -- [ ] Removed aliase _.select +- [ ] Removed aliase _.run +- [x] Removed aliase _.select - [x] Removed aliase _.unique Other changes @@ -7927,165 +7927,6 @@ declare module _ { sampleSize(): LoDashImplicitWrapper; } - //_.select - interface LoDashStatic { - /** - * @see _.filter - */ - select( - collection: List, - predicate?: ListIterator, - thisArg?: any - ): T[]; - - /** - * @see _.filter - */ - select( - collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any - ): T[]; - - /** - * @see _.filter - */ - select( - collection: string, - predicate?: StringIterator, - thisArg?: any - ): string[]; - - /** - * @see _.filter - */ - select( - collection: List|Dictionary, - predicate: string, - thisArg?: any - ): T[]; - - /** - * @see _.filter - */ - select( - collection: List|Dictionary, - predicate: W - ): T[]; - } - - interface LoDashImplicitWrapper { - /** - * @see _.filter - */ - select( - predicate?: StringIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitArrayWrapper { - /** - * @see _.filter - */ - select( - predicate: ListIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - select( - predicate: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - select(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashImplicitObjectWrapper { - /** - * @see _.filter - */ - select( - predicate: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - select( - predicate: string, - thisArg?: any - ): LoDashImplicitArrayWrapper; - - /** - * @see _.filter - */ - select(predicate: W): LoDashImplicitArrayWrapper; - } - - interface LoDashExplicitWrapper { - /** - * @see _.filter - */ - select( - predicate?: StringIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitArrayWrapper { - /** - * @see _.filter - */ - select( - predicate: ListIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - select( - predicate: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - select(predicate: W): LoDashExplicitArrayWrapper; - } - - interface LoDashExplicitObjectWrapper { - /** - * @see _.filter - */ - select( - predicate: ListIterator|DictionaryIterator, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - select( - predicate: string, - thisArg?: any - ): LoDashExplicitArrayWrapper; - - /** - * @see _.filter - */ - select(predicate: W): LoDashExplicitArrayWrapper; - } - //_.shuffle interface LoDashStatic { /**