Merge pull request #12824 from ethanresnick/superagent-callback-fix

Superagent callback fix
This commit is contained in:
Nathan Shively-Sanders
2016-11-24 08:18:50 -08:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -49,7 +49,7 @@ declare namespace request {
search(url: string, callback?: CallbackHandler): Req;
connect(url: string, callback?: CallbackHandler): Req;
parse(fn: (res: Response, callback: (err: Error, body: any) => void) => void): this;
parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this;
saveCookies(res: Response): void;
attachCookies(req: Req): void;
}
@@ -109,7 +109,7 @@ declare namespace request {
withCredentials(): this;
write(data: string, encoding?: string): this;
write(data: Buffer, encoding?: string): this;
parse(fn: (res: Response, callback: (err: Error, body: any) => void) => void): this;
parse(fn: (res: Response, callback: (err: Error | null, body: any) => void) => void): this;
}
}

View File

@@ -303,7 +303,7 @@ request
request
.get('/search')
.then((response) => {})
.catch((error) => {});
.catch((error) => {});
// Requesting binary data.
// adapted from: https://github.com/visionmedia/superagent/blob/v2.0.0/test/client/request.js#L110
request

View File

@@ -3,7 +3,7 @@
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"