mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #6554 from chrootsu/lodash-slice
lodash: signatures of the method _.slice changed
This commit is contained in:
+26
-9
@@ -914,15 +914,32 @@ module TestRest {
|
||||
}
|
||||
|
||||
// _.slice
|
||||
{
|
||||
let testSliceArray: TResult[];
|
||||
let result: TResult[];
|
||||
result = _.slice(testSliceArray);
|
||||
result = _.slice(testSliceArray, 42);
|
||||
result = _.slice(testSliceArray, 42, 42);
|
||||
result = _(testSliceArray).slice().value();
|
||||
result = _(testSliceArray).slice(42).value();
|
||||
result = _(testSliceArray).slice(42, 42).value();
|
||||
module TestSlice {
|
||||
let array: TResult[];
|
||||
|
||||
{
|
||||
let result: TResult[];
|
||||
|
||||
result = _.slice(array);
|
||||
result = _.slice(array, 42);
|
||||
result = _.slice(array, 42, 42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashImplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).slice();
|
||||
result = _(array).slice(42);
|
||||
result = _(array).slice(42, 42);
|
||||
}
|
||||
|
||||
{
|
||||
let result: _.LoDashExplicitArrayWrapper<TResult>;
|
||||
|
||||
result = _(array).chain().slice();
|
||||
result = _(array).chain().slice(42);
|
||||
result = _(array).chain().slice(42, 42);
|
||||
}
|
||||
}
|
||||
|
||||
result = <number>_.sortedIndex([20, 30, 50], 40);
|
||||
|
||||
Vendored
+10
@@ -1599,6 +1599,16 @@ declare module _ {
|
||||
): LoDashImplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
interface LoDashExplicitArrayWrapper<T> {
|
||||
/**
|
||||
* @see _.slice
|
||||
*/
|
||||
slice(
|
||||
start?: number,
|
||||
end?: number
|
||||
): LoDashExplicitArrayWrapper<T>;
|
||||
}
|
||||
|
||||
//_.sortedIndex
|
||||
interface LoDashStatic {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user