From 1a003c8e1029e90b842f0447dd7a74c9d2b2b892 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 31 Oct 2015 23:37:19 +0500 Subject: [PATCH] lodash: signatures of the method _.intersection changed --- lodash/lodash-tests.ts | 40 ++++++++++++++++++++++++++++++---------- lodash/lodash.d.ts | 14 ++++++++++++++ 2 files changed, 44 insertions(+), 10 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..5bf32c8a6 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -477,16 +477,36 @@ module TestIndexOf { } // _.intersection -{ - let testIntersectionArray: TResult[]; - let testIntersectionList: _.List; - let result: TResult[]; - result = _.intersection(testIntersectionArray, testIntersectionList); - result = _.intersection(testIntersectionList, testIntersectionArray, testIntersectionList); - result = _(testIntersectionArray).intersection(testIntersectionArray).value(); - result = _(testIntersectionArray).intersection(testIntersectionList, testIntersectionArray).value(); - result = _(testIntersectionList).intersection(testIntersectionArray).value(); - result = _(testIntersectionList).intersection(testIntersectionList, testIntersectionArray).value(); +module TestIntersection { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[]; + + result = _.intersection(array, list); + result = _.intersection(list, array, list); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).intersection(array); + result = _(array).intersection(list, array); + + result = _(list).intersection(array); + result = _(list).intersection(list, array); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().intersection(array); + result = _(array).chain().intersection(list, array); + + result = _(list).chain().intersection(array); + result = _(list).chain().intersection(list, array); + } } // _.last diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..6fca42717 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -983,6 +983,20 @@ declare module _ { intersection(...arrays: (TResult[]|List)[]): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.intersection + */ + intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.intersection + */ + intersection(...arrays: (TResult[]|List)[]): LoDashExplicitArrayWrapper; + } + //_.last interface LoDashStatic { /**