[lodash] Add stubTrue to lodash (#38920)

* [lodash] Add lodash/stubTrue

* Add stubTrue.d.ts to tsconfig.json

* Add lodash.stubtrue
This commit is contained in:
BehindTheMath
2019-10-09 15:13:29 -04:00
committed by Armando Aguirre
parent a83bc68922
commit 2ce5aacbd0
7 changed files with 69 additions and 0 deletions

10
types/lodash.stubtrue/index.d.ts vendored Normal file
View File

@@ -0,0 +1,10 @@
// Type definitions for lodash.stubTrue 4.13
// Project: http://lodash.com/
// Definitions by: Brian Zengel <https://github.com/bczengel>, Ilya Mochalov <https://github.com/chrootsu>, Stepan Mikhaylyuk <https://github.com/stepancar>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
// Generated from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/lodash/scripts/generate-modules.ts
import { stubTrue } from "lodash";
export = stubTrue;

View File

@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }

View File

@@ -1460,4 +1460,29 @@ declare module "../index" {
*/
uniqueId(): LoDashExplicitWrapper<string>;
}
// 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>;
}
}

View File

@@ -7077,3 +7077,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
types/lodash/stubTrue.d.ts vendored Normal file
View File

@@ -0,0 +1,2 @@
import { stubTrue } from "./index";
export = stubTrue;

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",