diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index f23220229..48fac68e5 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -659,23 +659,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 3dba7abe9..fd8924fca 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1221,6 +1221,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 { /**