From f0a416773ad2490ae636a697bce81c14c977b38e Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Fri, 30 Oct 2015 01:43:11 +0500 Subject: [PATCH] lodash: signatures of the method _.dropRight changed --- lodash/lodash-tests.ts | 40 +++++++++++++++++++++++++++++++--------- lodash/lodash.d.ts | 14 ++++++++++++++ 2 files changed, 45 insertions(+), 9 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..15cb98e22 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -216,15 +216,37 @@ module TestCompact { module TestDropRight { let array: TResult[]; let list: _.List; - let result: TResult[]; - result = _.dropRight(array); - result = _.dropRight(array, 42); - result = _.dropRight(list); - result = _.dropRight(list, 42); - result = _(array).dropRight().value(); - result = _(array).dropRight(42).value(); - result = _(list).dropRight().value(); - result = _(list).dropRight(42).value(); + + { + let result: TResult[]; + + result = _.dropRight(array); + result = _.dropRight(array, 42); + + result = _.dropRight(list); + result = _.dropRight(list, 42); + + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).dropRight(); + result = _(array).dropRight(42); + + result = _(list).dropRight(); + result = _(list).dropRight(42); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().dropRight(); + result = _(array).chain().dropRight(42); + + result = _(list).chain().dropRight(); + result = _(list).chain().dropRight(42); + } } // _.dropRightWhile diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..f37a1b657 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -391,6 +391,20 @@ declare module _ { dropRight(n?: number): LoDashImplicitArrayWrapper; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.dropRight + */ + dropRight(n?: number): LoDashExplicitArrayWrapper; + } + //_.dropRightWhile interface LoDashStatic { /**