mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
add github-url-from-git (#38576)
This commit is contained in:
parent
56b659e0f0
commit
46c2eed830
6
types/github-url-from-git/github-url-from-git-tests.ts
Normal file
6
types/github-url-from-git/github-url-from-git-tests.ts
Normal file
@ -0,0 +1,6 @@
|
||||
import * as parse from 'github-url-from-git';
|
||||
|
||||
parse('https://github.com/jamesor/mongoose-versioner'); // $ExpectType string
|
||||
parse('git://github.internal.example.com/treygriffith/cellar.git', { extraBaseUrls: ['github.internal.example.com'] }); // $ExpectType string
|
||||
parse.re(); // $ExpectType RegExp
|
||||
parse.re({ extraBaseUrls: ['github.internal.example.com'] }); // $ExpectType RegExp
|
||||
32
types/github-url-from-git/index.d.ts
vendored
Normal file
32
types/github-url-from-git/index.d.ts
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
// Type definitions for node-github-url-from-git 1.5
|
||||
// Project: https://github.com/tj/node-github-url-from-git
|
||||
// Definitions by: Christian Murphy <https://github.com/ChristianMurphy>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.0
|
||||
|
||||
declare namespace githubUrlFromGit {
|
||||
interface githubUrlFromGitOptions {
|
||||
/**
|
||||
* additional URLs that should be treated as GitHub repos
|
||||
*/
|
||||
extraBaseUrls?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a regular expression to parse GitHub URLs
|
||||
*
|
||||
* @param opts options for regular expression generator
|
||||
*/
|
||||
function re(opts?: githubUrlFromGitOptions): RegExp;
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalize Git URLs into GitHub URLs
|
||||
*
|
||||
* @param url Git URL to process
|
||||
* @param opts options for URL parser
|
||||
* @returns GitHub URL
|
||||
*/
|
||||
declare function githubUrlFromGit(url: string, opts?: githubUrlFromGit.githubUrlFromGitOptions): string;
|
||||
|
||||
export = githubUrlFromGit;
|
||||
23
types/github-url-from-git/tsconfig.json
Normal file
23
types/github-url-from-git/tsconfig.json
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"github-url-from-git-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/github-url-from-git/tslint.json
Normal file
1
types/github-url-from-git/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Loading…
Reference in New Issue
Block a user