Merge pull request #23950 from danielgronberg/master

Added null as valid argument type to ssh2-sftp-client get
This commit is contained in:
Benjamin Lichtman
2018-02-28 13:38:36 -08:00
committed by GitHub
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ export = sftp;
declare class sftp {
connect(options: ssh2.ConnectConfig): Promise<void>;
list(remoteFilePath: string): Promise<sftp.FileInfo[]>;
get(remoteFilePath: string, useCompression?: boolean, encoding?: string): Promise<NodeJS.ReadableStream>;
get(remoteFilePath: string, useCompression?: boolean, encoding?: string | null): Promise<NodeJS.ReadableStream>;
put(input: string | Buffer | NodeJS.ReadableStream, remoteFilePath: string, useCompression?: boolean, encoding?: string): Promise<void>;
mkdir(remoteFilePath: string, recursive?: boolean): Promise<void>;
rmdir(remoteFilePath: string, recursive?: boolean): Promise<void>;
@@ -12,7 +12,8 @@ client.connect({
client.list('/remote/path').then(() => null);
client.get('/remote/path').then(stream => stream.read(0));
client.get('/remote/path', true, 'binary').then(stream => stream.read(0));
client.get('/remote/path', true, 'utf8').then(stream => stream.read(0));
client.get('/remote/path', true, null).then(stream => stream.read(0));
client.put('/local/path', '/remote/path').then(() => null);
client.put(new Buffer('content'), '/remote/path').then(() => null);
+1 -1
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [