[github-username-regex] Add definitions (#20665)

* [github-username-regex] Add definitions

* [github-username-regex] Change to match CommonJS export format
This commit is contained in:
BehindTheMath
2017-10-19 16:15:07 -07:00
committed by Andy
parent 149031f781
commit dd980c087a
4 changed files with 35 additions and 0 deletions
@@ -0,0 +1,4 @@
import githubUsernameRegex = require("github-username-regex");
const githubUsernameRegexString: string = githubUsernameRegex.source;
const valid: boolean = githubUsernameRegex.test("abc-123");
+7
View File
@@ -0,0 +1,7 @@
// Type definitions for github-username-regex 1.0
// Project: https://github.com/shinnn/github-username-regex
// Definitions by: BehindTheMath <https://github.com/BehindTheMath>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare const githubUsernameRegex: RegExp;
export = githubUsernameRegex;
+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",
"github-username-regex-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }