diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index e28ff2768..fc3d7bb58 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -262,15 +262,37 @@ module TestDifference { 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 2972135ba..f5b7663eb 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -419,6 +419,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 { /**