Merge pull request #6729 from chrootsu/lodash-without

lodash: signatures of the method _.without have been changed
This commit is contained in:
Masahiro Wakame
2015-11-16 22:31:04 +09:00
2 changed files with 60 additions and 22 deletions
+44 -20
View File
@@ -1460,26 +1460,50 @@ module TestUnzip {
}
// _.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
@@ -2810,7 +2810,7 @@ declare module _ {
* @return Returns the new array of filtered values.
*/
without<T>(
array: T[]|List<T>,
array: List<T>,
...values: T[]
): T[];
}
@@ -2826,7 +2826,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