From 20c8f8348b03917a3672561a801156d362e2030a Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 31 Oct 2015 23:55:55 +0500 Subject: [PATCH] lodash: signatures of the method _.pull changed --- lodash/lodash-tests.ts | 83 +++++++++++++++++++++++++++++------------- lodash/lodash.d.ts | 14 +++++++ 2 files changed, 72 insertions(+), 25 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041b..1b69fd86a8 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -589,31 +589,64 @@ module TestObject { } // _.pull -{ - let testPullArray: TResult[]; - let testPullValue: TResult; - let result: TResult[]; - result = _.pull(testPullArray); - result = _.pull(testPullArray, testPullValue); - result = _.pull(testPullArray, testPullValue, testPullValue); - result = _.pull(testPullArray, testPullValue, testPullValue, testPullValue); - result = _(testPullArray).pull().value(); - result = _(testPullArray).pull(testPullValue).value(); - result = _(testPullArray).pull(testPullValue, testPullValue).value(); - result = _(testPullArray).pull(testPullValue, testPullValue, testPullValue).value(); -} -{ - let testPullList: _.List; - let testPullValue: TResult; - let result: _.List; - result = _.pull(testPullList); - result = _.pull(testPullList, testPullValue); - result = _.pull(testPullList, testPullValue, testPullValue); - result = _.pull(testPullList, testPullValue, testPullValue, testPullValue); - result = _(testPullList).pull().value(); - result = _(testPullList).pull(testPullValue).value(); - result = _(testPullList).pull(testPullValue, testPullValue).value(); - result = _(testPullList).pull(testPullValue, testPullValue, testPullValue).value(); +module TestPull { + let array: TResult[]; + let list: _.List; + let value: TResult; + + { + let result: TResult[]; + + result = _.pull(array); + result = _.pull(array, value); + result = _.pull(array, value, value); + result = _.pull(array, value, value, value); + } + + { + let result: _.List; + + result = _.pull(list); + result = _.pull(list, value); + result = _.pull(list, value, value); + result = _.pull(list, value, value, value); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).pull(); + result = _(array).pull(value); + result = _(array).pull(value, value); + result = _(array).pull(value, value, value); + } + + { + let result: _.LoDashImplicitObjectWrapper<_.List>; + + result = _(list).pull(); + result = _(list).pull(value); + result = _(list).pull(value, value); + result = _(list).pull(value, value, value); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().pull(); + result = _(array).chain().pull(value); + result = _(array).chain().pull(value, value); + result = _(array).chain().pull(value, value, value); + } + + { + let result: _.LoDashExplicitObjectWrapper<_.List>; + + result = _(list).chain().pull(); + result = _(list).chain().pull(value); + result = _(list).chain().pull(value, value); + result = _(list).chain().pull(value, value, value); + } } // _.pullAt diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e657..1d77a6b22d 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1157,6 +1157,20 @@ declare module _ { pull(...values: TValue[]): LoDashImplicitObjectWrapper>; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.pull + */ + pull(...values: T[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.pull + */ + pull(...values: TValue[]): LoDashExplicitObjectWrapper>; + } + //_.pullAt interface LoDashStatic { /**