diff --git a/types/lodash/index.d.ts b/types/lodash/index.d.ts index 910e29bd95..f5f94bf899 100644 --- a/types/lodash/index.d.ts +++ b/types/lodash/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for Lo-Dash 4.14 // Project: http://lodash.com/ -// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk , Eric L Anderson +// Definitions by: Brian Zengel , Ilya Mochalov , Stepan Mikhaylyuk , Eric L Anderson , AJ Richardson // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.2 @@ -485,7 +485,7 @@ declare namespace _ { * @param array The array to compact. * @return (Array) Returns the new array of filtered values. */ - compact(array?: List | null | undefined): T[]; + compact(array?: List | null | undefined): T[]; } interface LoDashImplicitArrayWrapperBase { diff --git a/types/lodash/lodash-tests.ts b/types/lodash/lodash-tests.ts index a11485ca07..83f9476395 100644 --- a/types/lodash/lodash-tests.ts +++ b/types/lodash/lodash-tests.ts @@ -207,6 +207,8 @@ namespace TestChunk { namespace TestCompact { let array: TResult[] | null | undefined = [] as any; let list: _.List | null | undefined = [] as any; + let array2: Array | null | undefined = any; + let list2: _.List | null | undefined = any; { let result: TResult[]; @@ -214,6 +216,8 @@ namespace TestCompact { result = _.compact(); result = _.compact(array); result = _.compact(list); + result = _.compact(array2); + result = _.compact(list2); } {