lodash: signatures of the method _.intersection changed

This commit is contained in:
Ilya Mochalov
2015-10-31 23:44:54 +05:00
parent eb59a40d3c
commit 1a003c8e10
2 changed files with 44 additions and 10 deletions
+30 -10
View File
@@ -477,16 +477,36 @@ module TestIndexOf {
}
// _.intersection
{
let testIntersectionArray: TResult[];
let testIntersectionList: _.List<TResult>;
let result: TResult[];
result = _.intersection<TResult>(testIntersectionArray, testIntersectionList);
result = _.intersection<TResult>(testIntersectionList, testIntersectionArray, testIntersectionList);
result = _(testIntersectionArray).intersection<TResult>(testIntersectionArray).value();
result = _(testIntersectionArray).intersection<TResult>(testIntersectionList, testIntersectionArray).value();
result = _(testIntersectionList).intersection<TResult>(testIntersectionArray).value();
result = _(testIntersectionList).intersection<TResult>(testIntersectionList, testIntersectionArray).value();
module TestIntersection {
let array: TResult[];
let list: _.List<TResult>;
{
let result: TResult[];
result = _.intersection<TResult>(array, list);
result = _.intersection<TResult>(list, array, list);
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).intersection<TResult>(array);
result = _(array).intersection<TResult>(list, array);
result = _(list).intersection<TResult>(array);
result = _(list).intersection<TResult>(list, array);
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().intersection<TResult>(array);
result = _(array).chain().intersection<TResult>(list, array);
result = _(list).chain().intersection<TResult>(array);
result = _(list).chain().intersection<TResult>(list, array);
}
}
// _.last
+14
View File
@@ -983,6 +983,20 @@ declare module _ {
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashImplicitArrayWrapper<TResult>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.intersection
*/
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.intersection
*/
intersection<TResult>(...arrays: (TResult[]|List<TResult>)[]): LoDashExplicitArrayWrapper<TResult>;
}
//_.last
interface LoDashStatic {
/**