From 339a42d7a8fd71b9d6d631187d03fc7d1b0e71a6 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sun, 1 Nov 2015 07:00:56 +0500 Subject: [PATCH] lodash: signatures of the method _.union changed --- lodash/lodash-tests.ts | 57 +++++++++++++++++++++++++++++------------- lodash/lodash.d.ts | 19 ++++++++++++++ 2 files changed, 59 insertions(+), 17 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..0f8ad5f15 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -829,29 +829,52 @@ module TestTakeWhile { module TestUnion { let array: TResult[]; let list: _.List; - let result: TResult[]; - result = _.union(); + { + let result: TResult[]; - result = _.union(array); - result = _.union(array, list); - result = _.union(array, list, array); + result = _.union(); - result = _.union(list); - result = _.union(list, array); - result = _.union(list, array, list); + result = _.union(array); + result = _.union(array, list); + result = _.union(array, list, array); - result = _(array).union().value(); - result = _(array).union(list).value(); - result = _(array).union(list, array).value(); + result = _.union(list); + result = _.union(list, array); + result = _.union(list, array, list); + } - result = _(array).union().value(); - result = _(array).union(list).value(); - result = _(array).union(list, array).value(); + { + let result: _.LoDashImplicitArrayWrapper; - result = _(list).union().value(); - result = _(list).union(array).value(); - result = _(list).union(array, list).value(); + result = _(array).union(); + result = _(array).union(list); + result = _(array).union(list, array); + + result = _(array).union(); + result = _(array).union(list); + result = _(array).union(list, array); + + result = _(list).union(); + result = _(list).union(array); + result = _(list).union(array, list); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().union(); + result = _(array).chain().union(list); + result = _(array).chain().union(list, array); + + result = _(array).chain().union(); + result = _(array).chain().union(list); + result = _(array).chain().union(list, array); + + result = _(list).chain().union(); + result = _(list).chain().union(array); + result = _(list).chain().union(array, list); + } } result = _.uniq([1, 2, 1, 3, 1]); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..befb0ca3e 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1708,6 +1708,25 @@ declare module _ { union(...arrays: List[]): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.union + */ + union(...arrays: List[]): LoDashExplicitArrayWrapper; + + /** + * @see _.union + */ + union(...arrays: List[]): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.union + */ + union(...arrays: List[]): LoDashExplicitArrayWrapper; + } + //_.uniq interface LoDashStatic { /**