lodash: signatures of the method _.without have been changed

This commit is contained in:
Ilya Mochalov
2015-11-12 15:11:28 +05:00
parent 708609e076
commit f94388c1c9
2 changed files with 60 additions and 22 deletions
+44 -20
View File
@@ -1427,26 +1427,50 @@ result = <{ x: number; }[]>_([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }]).unique('x').v
}
// _.without
{
let testWithoutArray: number[];
let testWithoutList: _.List<number>;
let result: number[];
result = _.without<number>(testWithoutArray);
result = _.without<number>(testWithoutArray, 1);
result = _.without<number>(testWithoutArray, 1, 2);
result = _.without<number>(testWithoutArray, 1, 2, 3);
result = _.without<number>(testWithoutList);
result = _.without<number>(testWithoutList, 1);
result = _.without<number>(testWithoutList, 1, 2);
result = _.without<number>(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<number>().value();
result = _(testWithoutList).without<number>(1).value();
result = _(testWithoutList).without<number>(1, 2).value();
result = _(testWithoutList).without<number>(1, 2, 3).value();
module TestWithout {
let array: number[];
let list: _.List<number>;
{
let result: number[];
result = _.without<number>(array);
result = _.without<number>(array, 1);
result = _.without<number>(array, 1, 2);
result = _.without<number>(array, 1, 2, 3);
result = _.without<number>(list);
result = _.without<number>(list, 1);
result = _.without<number>(list, 1, 2);
result = _.without<number>(list, 1, 2, 3);
}
{
let result: _.LoDashImplicitArrayWrapper<number>;
result = _(array).without();
result = _(array).without(1);
result = _(array).without(1, 2);
result = _(array).without(1, 2, 3);
result = _(list).without<number>();
result = _(list).without<number>(1);
result = _(list).without<number>(1, 2);
result = _(list).without<number>(1, 2, 3);
}
{
let result: _.LoDashExplicitArrayWrapper<number>;
result = _(array).chain().without();
result = _(array).chain().without(1);
result = _(array).chain().without(1, 2);
result = _(array).chain().without(1, 2, 3);
result = _(list).chain().without<number>();
result = _(list).chain().without<number>(1);
result = _(list).chain().without<number>(1, 2);
result = _(list).chain().without<number>(1, 2, 3);
}
}
// _.xor
+16 -2
View File
@@ -2770,7 +2770,7 @@ declare module _ {
* @return Returns the new array of filtered values.
*/
without<T>(
array: T[]|List<T>,
array: List<T>,
...values: T[]
): T[];
}
@@ -2786,7 +2786,21 @@ declare module _ {
/**
* @see _.without
*/
without<TValue>(...values: TValue[]): LoDashImplicitArrayWrapper<TValue>;
without<T>(...values: T[]): LoDashImplicitArrayWrapper<T>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.without
*/
without(...values: T[]): LoDashExplicitArrayWrapper<T>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.without
*/
without<T>(...values: T[]): LoDashExplicitArrayWrapper<T>;
}
//_.xor