Add types for is-ssh (#37807)

This commit is contained in:
Florian Keller 2019-08-21 19:28:52 +02:00 committed by Sheetal Nandi
parent c4b93707db
commit 67612a87f4
4 changed files with 42 additions and 0 deletions

12
types/is-ssh/index.d.ts vendored Normal file
View File

@ -0,0 +1,12 @@
// Type definitions for is-ssh 1.3
// Project: https://github.com/IonicaBizau/node-is-ssh
// Definitions by: Florian Keller <https://github.com/ffflorian>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* @param input The input url or an array of protocols.
* @returns `true` if the input is a ssh url, `false` otherwise.
*/
declare function isSsh(input: string | string[]): boolean;
export = isSsh;

View File

@ -0,0 +1,6 @@
import isSsh = require('is-ssh');
isSsh('ssh://user@host.xz:port/path/to/repo.git/'); // $ExpectType boolean
isSsh('ssh://user@host.xz/path/to/repo.git/'); // $ExpectType boolean
isSsh('ssh://host.xz:port/path/to/repo.git/'); // $ExpectType boolean
isSsh('ssh://host.xz/path/to/repo.git/'); // $ExpectType boolean

View 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",
"is-ssh-tests.ts"
]
}

1
types/is-ssh/tslint.json Normal file
View File

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