Merge pull request #6554 from chrootsu/lodash-slice

lodash: signatures of the method _.slice changed
This commit is contained in:
Masahiro Wakame
2015-11-02 23:37:47 +09:00
2 changed files with 36 additions and 9 deletions
+26 -9
View File
@@ -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);
+10
View File
@@ -1599,6 +1599,16 @@ declare module _ {
): LoDashImplicitArrayWrapper<T>;
}
interface LoDashExplicitArrayWrapper<T> {
/**
* @see _.slice
*/
slice(
start?: number,
end?: number
): LoDashExplicitArrayWrapper<T>;
}
//_.sortedIndex
interface LoDashStatic {
/**