Merge pull request #31684 from BendingBender/git-username

[git-username] Add types
This commit is contained in:
Wesley Wigham
2018-12-25 13:03:04 -08:00
committed by GitHub
4 changed files with 49 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
import username = require('git-username');
username('some/path'); // $ExpectType string | null
username({ cwd: 'some/path' }); // $ExpectType string | null
username({ strict: true }); // $ExpectType string
+20
View File
@@ -0,0 +1,20 @@
// Type definitions for git-username 1.0
// Project: https://github.com/jonschlinkert/git-username
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = gitUsername;
declare function gitUsername(options: gitUsername.StrictOptions): string;
declare function gitUsername(options?: string | gitUsername.BaseOptions): string | null;
declare namespace gitUsername {
interface BaseOptions {
cwd?: string;
strict?: boolean;
}
interface StrictOptions extends BaseOptions {
strict: true;
}
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"git-username-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }