mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #6845 from chrootsu/lodash-pullAt
lodash: signatures of _.pullAt have been changed
This commit is contained in:
+45
-20
@@ -997,26 +997,51 @@ module TestPull {
|
||||
}
|
||||
|
||||
// _.pullAt
|
||||
{
|
||||
let testPullAtArray: TResult[];
|
||||
let testPullAtList: _.List<TResult>;
|
||||
let result: TResult[];
|
||||
result = _.pullAt<TResult>(testPullAtArray);
|
||||
result = _.pullAt<TResult>(testPullAtArray, 1);
|
||||
result = _.pullAt<TResult>(testPullAtArray, [2, 3], 1);
|
||||
result = _.pullAt<TResult>(testPullAtArray, 4, [2, 3], 1);
|
||||
result = _.pullAt<TResult>(testPullAtList);
|
||||
result = _.pullAt<TResult>(testPullAtList, 1);
|
||||
result = _.pullAt<TResult>(testPullAtList, [2, 3], 1);
|
||||
result = _.pullAt<TResult>(testPullAtList, 4, [2, 3], 1);
|
||||
result = _(testPullAtArray).pullAt().value();
|
||||
result = _(testPullAtArray).pullAt(1).value();
|
||||
result = _(testPullAtArray).pullAt([2, 3], 1).value();
|
||||
result = _(testPullAtArray).pullAt(4, [2, 3], 1).value();
|
||||
result = _(testPullAtList).pullAt<TResult>().value();
|
||||
result = _(testPullAtList).pullAt<TResult>(1).value();
|
||||
result = _(testPullAtList).pullAt<TResult>([2, 3], 1).value();
|
||||
result = _(testPullAtList).pullAt<TResult>(4, [2, 3], 1).value();
|
||||
module TestPullAt {
|
||||
let array: TResult[];
|
||||
let list: _.List<TResult>;
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.pullAt<TResult>(array);
|
||||
result = _.pullAt<TResult>(array, 1);
|
||||
result = _.pullAt<TResult>(array, [2, 3], 1);
|
||||
result = _.pullAt<TResult>(array, 4, [2, 3], 1);
|
||||
|
||||
result = _.pullAt<TResult>(list);
|
||||
result = _.pullAt<TResult>(list, 1);
|
||||
result = _.pullAt<TResult>(list, [2, 3], 1);
|
||||
result = _.pullAt<TResult>(list, 4, [2, 3], 1);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).pullAt();
|
||||
result = _(array).pullAt(1);
|
||||
result = _(array).pullAt([2, 3], 1);
|
||||
result = _(array).pullAt(4, [2, 3], 1);
|
||||
|
||||
result = _(list).pullAt<TResult>();
|
||||
result = _(list).pullAt<TResult>(1);
|
||||
result = _(list).pullAt<TResult>([2, 3], 1);
|
||||
result = _(list).pullAt<TResult>(4, [2, 3], 1);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).chain().pullAt();
|
||||
result = _(array).chain().pullAt(1);
|
||||
result = _(array).chain().pullAt([2, 3], 1);
|
||||
result = _(array).chain().pullAt(4, [2, 3], 1);
|
||||
|
||||
result = _(list).chain().pullAt<TResult>();
|
||||
result = _(list).chain().pullAt<TResult>(1);
|
||||
result = _(list).chain().pullAt<TResult>([2, 3], 1);
|
||||
result = _(list).chain().pullAt<TResult>(4, [2, 3], 1);
|
||||
}
|
||||
}
|
||||
|
||||
// _.remove
|
||||
|
||||
Vendored
+16
-2
@@ -1582,7 +1582,7 @@ declare module _ {
|
||||
* @return Returns the new array of removed elements.
|
||||
*/
|
||||
pullAt<T>(
|
||||
array: T[]|List<T>,
|
||||
array: List<T>,
|
||||
...indexes: (number|number[])[]
|
||||
): T[];
|
||||
}
|
||||
@@ -1598,7 +1598,21 @@ declare module _ {
|
||||
/**
|
||||
* @see _.pullAt
|
||||
*/
|
||||
pullAt<TValue>(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<TValue>;
|
||||
pullAt<T>(...indexes: (number|number[])[]): LoDashImplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.pullAt
|
||||
*/
|
||||
pullAt(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitObjectWrapper<T> {
|
||||
/**
|
||||
* @see _.pullAt
|
||||
*/
|
||||
pullAt<T>(...indexes: (number|number[])[]): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.remove
|
||||
|
||||
Reference in New Issue
Block a user