diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..35a17a760 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -506,23 +506,38 @@ module TestLastIndexOf { let array: TResult[]; let list: _.List; let value: TResult; - let result: number; - result = _.lastIndexOf(array, value); - result = _.lastIndexOf(array, value, true); - result = _.lastIndexOf(array, value, 42); + { + let result: number; - result = _.lastIndexOf(list, value); - result = _.lastIndexOf(list, value, true); - result = _.lastIndexOf(list, value, 42); + result = _.lastIndexOf(array, value); + result = _.lastIndexOf(array, value, true); + result = _.lastIndexOf(array, value, 42); - result = _(array).lastIndexOf(value); - result = _(array).lastIndexOf(value, true); - result = _(array).lastIndexOf(value, 42); + result = _.lastIndexOf(list, value); + result = _.lastIndexOf(list, value, true); + result = _.lastIndexOf(list, value, 42); - result = _(list).lastIndexOf(value); - result = _(list).lastIndexOf(value, true); - result = _(list).lastIndexOf(value, 42); + result = _(array).lastIndexOf(value); + result = _(array).lastIndexOf(value, true); + result = _(array).lastIndexOf(value, 42); + + result = _(list).lastIndexOf(value); + result = _(list).lastIndexOf(value, true); + result = _(list).lastIndexOf(value, 42); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().lastIndexOf(value); + result = _(array).chain().lastIndexOf(value, true); + result = _(array).chain().lastIndexOf(value, 42); + + result = _(list).chain().lastIndexOf(value); + result = _(list).chain().lastIndexOf(value, true); + result = _(list).chain().lastIndexOf(value, 42); + } } // _.object diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index d143f4e65..9f11aad27 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1045,6 +1045,26 @@ declare module _ { ): number; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.lastIndexOf + */ + lastIndexOf( + value: TResult, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + //_.object interface LoDashStatic { /**