Merge pull request #6604 from chrootsu/lodash-drop

lodash: signatures of the method _.drop have been changed
This commit is contained in:
Masahiro Wakame
2015-11-05 22:45:30 +09:00
2 changed files with 46 additions and 12 deletions
+31 -11
View File
@@ -260,17 +260,37 @@ module TestDifference {
// _.drop
{
let testDropArray: TResult[];
let testDropList: _.List<TResult>;
let result: TResult[];
result = _.drop<TResult>(testDropArray);
result = _.drop<TResult>(testDropArray, 42);
result = _.drop<TResult>(testDropList);
result = _.drop<TResult>(testDropList, 42);
result = _(testDropArray).drop().value();
result = _(testDropArray).drop(42).value();
result = _(testDropList).drop<TResult>().value();
result = _(testDropList).drop<TResult>(42).value();
let array: TResult[];
let list: _.List<TResult>;
{
let result: TResult[];
result = _.drop<TResult>(array);
result = _.drop<TResult>(array, 42);
result = _.drop<TResult>(list);
result = _.drop<TResult>(list, 42);
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(array).drop();
result = _(array).drop(42);
result = _(list).drop<TResult>();
result = _(list).drop<TResult>(42);
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(array).chain().drop();
result = _(array).chain().drop(42);
result = _(list).chain().drop<TResult>();
result = _(list).chain().drop<TResult>(42);
}
}
// _.dropRight
+15 -1
View File
@@ -401,7 +401,21 @@ declare module _ {
/**
* @see _.drop
*/
drop<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
drop<T>(n?: number): LoDashImplicitArrayWrapper<T>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.drop
*/
drop(n?: number): LoDashExplicitArrayWrapper<T>;
}
interface LoDashExplicitObjectWrapper<T> {
/**
* @see _.drop
*/
drop<T>(n?: number): LoDashExplicitArrayWrapper<T>;
}
//_.dropRight