diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 2f05d5bc3d..8bc80cb683 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -497,7 +497,28 @@ result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').v result = _(testUnzipWithList).unzipWith(testUnzipWithIterator, any).value(); } -result = _.without([1, 2, 1, 0, 3, 1, 4], 0, 1); +// _.without +{ + let testWithoutArray: number[]; + let testWithoutList: _.List; + let result: number[]; + result = _.without(testWithoutArray); + result = _.without(testWithoutArray, 1); + result = _.without(testWithoutArray, 1, 2); + result = _.without(testWithoutArray, 1, 2, 3); + result = _.without(testWithoutList); + result = _.without(testWithoutList, 1); + result = _.without(testWithoutList, 1, 2); + result = _.without(testWithoutList, 1, 2, 3); + result = _(testWithoutArray).without().value(); + result = _(testWithoutArray).without(1).value(); + result = _(testWithoutArray).without(1, 2).value(); + result = _(testWithoutArray).without(1, 2, 3).value(); + result = _(testWithoutList).without().value(); + result = _(testWithoutList).without(1).value(); + result = _(testWithoutList).without(1, 2).value(); + result = _(testWithoutList).without(1, 2, 3).value(); +} // _.xor var testXorArray: number[]; diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index ad97c101b2..172a250506 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1878,21 +1878,30 @@ declare module _ { //_.without interface LoDashStatic { /** - * Creates an array excluding all provided values using strict equality for comparisons, i.e. ===. - * @param array The array to filter. - * @param values The value(s) to exclude. - * @return A new array of filtered values. - **/ + * Creates an array excluding all provided values using SameValueZero for equality comparisons. + * + * @param array The array to filter. + * @param values The values to exclude. + * @return Returns the new array of filtered values. + */ without( - array: Array, - ...values: T[]): T[]; + array: T[]|List, + ...values: T[] + ): T[]; + } + interface LoDashArrayWrapper { /** - * @see _.without - **/ - without( - array: List, - ...values: T[]): T[]; + * @see _.without + */ + without(...values: T[]): LoDashArrayWrapper; + } + + interface LoDashObjectWrapper { + /** + * @see _.without + */ + without(...values: TValue[]): LoDashArrayWrapper; } //_.xor