mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #6555 from chrootsu/lodash-take
lodash: signatures of the method _.take changed
This commit is contained in:
+30
-9
@@ -970,15 +970,36 @@ module TestTail {
|
||||
module TestTake {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
let result: TResult[];
|
||||
result = _.take<TResult>(array);
|
||||
result = _.take<TResult>(array, 42);
|
||||
result = _.take<TResult>(list);
|
||||
result = _.take<TResult>(list, 42);
|
||||
result = _(array).take().value();
|
||||
result = _(array).take(42).value();
|
||||
result = _(list).take<TResult>().value();
|
||||
result = _(list).take<TResult>(42).value();
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.take<TResult>(array);
|
||||
result = _.take<TResult>(array, 42);
|
||||
|
||||
result = _.take<TResult>(list);
|
||||
result = _.take<TResult>(list, 42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).take();
|
||||
result = _(array).take(42);
|
||||
|
||||
result = _(list).take<TResult>();
|
||||
result = _(list).take<TResult>(42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).chain().take();
|
||||
result = _(array).chain().take(42);
|
||||
|
||||
result = _(list).chain().take<TResult>();
|
||||
result = _(list).chain().take<TResult>(42);
|
||||
}
|
||||
}
|
||||
|
||||
// _.takeRight
|
||||
|
||||
Vendored
+14
@@ -1730,6 +1730,20 @@ declare module _ {
|
||||
take<TResult>(n?: number): LoDashImplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.take
|
||||
*/
|
||||
take(n?: number): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.take
|
||||
*/
|
||||
take<TResult>(n?: number): LoDashExplicitArrayWrapper<TResult>;
|
||||
}
|
||||
|
||||
//_.takeRight
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user