Merge pull request #6503 from chrootsu/lodash-times

lodash: signatures of the method _.times changed
This commit is contained in:
Masahiro Wakame
2015-11-02 22:25:05 +09:00
2 changed files with 59 additions and 15 deletions
+44 -15
View File
@@ -4499,6 +4499,50 @@ module TestNoop {
result = _({}).runInContext();
}
// _.times
module TestTimes {
let iteratee: (num: number) => TResult;
{
let result: number[];
result = _.times(42);
}
{
let result: TResult[];
result = _.times(42, iteratee);
result = _.times(42, iteratee, any);
}
{
let result: _.LoDashImplicitArrayWrapper<number>;
result = _(42).times();
}
{
let result: _.LoDashImplicitArrayWrapper<TResult>;
result = _(42).times(iteratee);
result = _(42).times(iteratee, any);
}
{
let result: _.LoDashExplicitArrayWrapper<number>;
result = _(42).chain().times();
}
{
let result: _.LoDashExplicitArrayWrapper<TResult>;
result = _(42).chain().times(iteratee);
result = _(42).chain().times(iteratee, any);
}
}
// _.uniqueId
result = <string>_.uniqueId();
result = <string>_.uniqueId('');
@@ -4508,21 +4552,6 @@ result = <string>_.VERSION;
result = <_.Support>_.support;
result = <_.TemplateSettings>_.templateSettings;
// _.times
{
let result: number[];
result = _.times(42);
result = _(42).times().value();
}
{
let testTimesFn: (num: number) => TResult;
let result: TResult[];
result = _.times(42, testTimesFn);
result = _.times(42, testTimesFn, any);
result = _(42).times(testTimesFn).value();
result = _(42).times(testTimesFn, any).value();
}
// _.partial & _.partialRight
{
function func0(): number {
+15
View File
@@ -10343,6 +10343,21 @@ declare module _ {
times(): LoDashImplicitArrayWrapper<number>;
}
interface LoDashExplicitWrapper<T> {
/**
* @see _.times
*/
times<TResult>(
iteratee: (num: number) => TResult,
thisArgs?: any
): LoDashExplicitArrayWrapper<TResult>;
/**
* @see _.times
*/
times(): LoDashExplicitArrayWrapper<number>;
}
//_.uniqueId
interface LoDashStatic {
/**