diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 43b95c756..de1331372 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -564,19 +564,38 @@ module TestIndexOf { let array: TResult[]; let list: _.List; let value: TResult; - let result: number; - result = _.indexOf(array, value); - result = _.indexOf(array, value, true); - result = _.indexOf(array, value, 42); - result = _.indexOf(list, value); - result = _.indexOf(list, value, true); - result = _.indexOf(list, value, 42); - result = _(array).indexOf(value); - result = _(array).indexOf(value, true); - result = _(array).indexOf(value, 42); - result = _(list).indexOf(value); - result = _(list).indexOf(value, true); - result = _(list).indexOf(value, 42); + + { + let result: number; + + result = _.indexOf(array, value); + result = _.indexOf(array, value, true); + result = _.indexOf(array, value, 42); + + result = _.indexOf(list, value); + result = _.indexOf(list, value, true); + result = _.indexOf(list, value, 42); + + result = _(array).indexOf(value); + result = _(array).indexOf(value, true); + result = _(array).indexOf(value, 42); + + result = _(list).indexOf(value); + result = _(list).indexOf(value, true); + result = _(list).indexOf(value, 42); + } + + { + let result: _.LoDashExplicitWrapper; + + result = _(array).chain().indexOf(value); + result = _(array).chain().indexOf(value, true); + result = _(array).chain().indexOf(value, 42); + + result = _(list).chain().indexOf(value); + result = _(list).chain().indexOf(value, true); + result = _(list).chain().indexOf(value, 42); + } } //_.initial diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 6401f31eb..6050e4ff3 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1074,6 +1074,26 @@ declare module _ { ): number; } + interface LoDashExplicitArrayWrapper { + /** + * @see _.indexOf + */ + indexOf( + value: T, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.indexOf + */ + indexOf( + value: TValue, + fromIndex?: boolean|number + ): LoDashExplicitWrapper; + } + //_.initial interface LoDashStatic { /**