mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Merge pull request #6503 from chrootsu/lodash-times
lodash: signatures of the method _.times changed
This commit is contained in:
+44
-15
@@ -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 {
|
||||
|
||||
Vendored
+15
@@ -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 {
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user