From 78923fb94ab06652b9f2837b5370fd09278e4804 Mon Sep 17 00:00:00 2001 From: Ilya Mochalov Date: Sat, 31 Oct 2015 23:05:13 +0500 Subject: [PATCH] lodash: signatures of the method _.indexOf changed --- lodash/lodash-tests.ts | 45 ++++++++++++++++++++++++++++++------------ lodash/lodash.d.ts | 20 +++++++++++++++++++ 2 files changed, 52 insertions(+), 13 deletions(-) diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 3afc49041..2242df3aa 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -450,19 +450,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 d143f4e65..3694c2167 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -932,6 +932,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 { /**