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

This commit is contained in:
Ilya Mochalov
2015-11-04 14:29:15 +05:00
parent 0dd29bf825
commit 5bb86fad50
2 changed files with 46 additions and 12 deletions
+31 -11
View File
@@ -245,17 +245,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
@@ -387,7 +387,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