[lodash] Fix stubTrue for TS v3.1+ (#40110)

* [lodash] Fix stubTrue for TS v3.1+

Adds files that were left out of 2ce5aac that are used for TS v3.1+.

* Fix errors
This commit is contained in:
BehindTheMath
2019-11-06 16:05:44 -08:00
committed by Nathan Shively-Sanders
parent 7936f4d588
commit c140acb6c8
4 changed files with 36 additions and 8 deletions
+25
View File
@@ -1158,4 +1158,29 @@ declare module "../index" {
*/
uniqueId(): StringChain;
}
// stubTrue
interface LoDashStatic {
/**
* This method returns true.
*
* @return Returns true.
*/
stubTrue(): true;
}
interface LoDashImplicitWrapper<TValue> {
/**
* @see _.stubTrue
*/
stubTrue(): true;
}
interface LoDashExplicitWrapper<TValue> {
/**
* @see _.stubTrue
*/
stubTrue(): LoDashExplicitWrapper<true>;
}
}
+8 -8
View File
@@ -6991,14 +6991,6 @@ fp.now(); // $ExpectType number
fp.stubString(); // $ExpectType string
}
// _.stubTrue
{
_.stubTrue(); // $ExpectType true
_(anything).stubTrue(); // $ExpectType true
_.chain(anything).stubTrue(); // $ExpectType PrimitiveChain<true>
fp.stubTrue(); // $ExpectType true
}
// _.times
{
const iteratee = (num: number): AbcObject => ({ a: 1, b: "", c: true });
@@ -7093,3 +7085,11 @@ _.templateSettings; // $ExpectType TemplateSettings
fp.partialRight(func1)([42]); // $ExpectType Function0<number>
fp.partialRight(func2)([42, fp.partialRight.placeholder]); // $ExpectType Function1<string, number>
}
// _.stubTrue
{
_.stubTrue(); // $ExpectType true
_("").stubTrue(); // $ExpectType true
_.chain("").stubTrue(); // $ExpectType LoDashExplicitWrapper<true>
fp.stubTrue(); // $ExpectType true
}
+2
View File
@@ -0,0 +1,2 @@
import { stubTrue } from "./index";
export = stubTrue;
+1
View File
@@ -261,6 +261,7 @@
"spread.d.ts",
"startCase.d.ts",
"startsWith.d.ts",
"stubTrue.d.ts",
"subtract.d.ts",
"sum.d.ts",
"sumBy.d.ts",