diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 48fac68e59..222f9bb53f 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -757,31 +757,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 fd8924fca8..202e72e421 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1353,6 +1353,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 { /**