diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 6a203a477..3c295b8ef 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -681,14 +681,30 @@ module TestIndexOf { } //_.initial -{ - let testInitalArray: TResult[]; - let testInitalList: _.List; - let result: TResult[]; - result = _.initial(testInitalArray); - result = _.initial(testInitalList); - result = _(testInitalArray).initial().value(); - result = _(testInitalList).initial().value(); +module TestInitial { + let array: TResult[]; + let list: _.List; + + { + let result: TResult[]; + + result = _.initial(array); + result = _.initial(list); + } + + { + let result: _.LoDashImplicitArrayWrapper; + + result = _(array).initial(); + result = _(list).initial(); + } + + { + let result: _.LoDashExplicitArrayWrapper; + + result = _(array).chain().initial(); + result = _(list).chain().initial(); + } } // _.intersection diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index 33db9a723..0a7966eae 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1230,7 +1230,7 @@ declare module _ { * @param array The array to query. * @return Returns the slice of array. */ - initial(array: T[]|List): T[]; + initial(array: List): T[]; } interface LoDashImplicitArrayWrapper { @@ -1244,7 +1244,21 @@ declare module _ { /** * @see _.initial */ - initial(): LoDashImplicitArrayWrapper; + initial(): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitArrayWrapper { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.initial + */ + initial(): LoDashExplicitArrayWrapper; } //_.intersection