Merge pull request #6549 from chrootsu/lodash-intersection

lodash: signatures of the method _.intersection changed
This commit is contained in:
Masahiro Wakame
2015-11-02 23:36:54 +09:00
2 changed files with 44 additions and 10 deletions
+30 -10
View File
@@ -610,16 +610,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
@@ -1145,6 +1145,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 {
/**