mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-02 00:03:15 +08:00
prettier and add type
This commit is contained in:
@@ -31,8 +31,9 @@ describe('auth', () => {
|
||||
|
||||
it('does basic http get request with pat token auth', async () => {
|
||||
const token = 'scbfb44vxzku5l4xgc3qfazn3lpk4awflfryc76esaiq7aypcbhs'
|
||||
const ph: am.PersonalAccessTokenCredentialHandler =
|
||||
new am.PersonalAccessTokenCredentialHandler(token)
|
||||
const ph: am.PersonalAccessTokenCredentialHandler = new am.PersonalAccessTokenCredentialHandler(
|
||||
token
|
||||
)
|
||||
|
||||
const http: httpm.HttpClient = new httpm.HttpClient('http-client-tests', [
|
||||
ph
|
||||
|
||||
@@ -57,8 +57,7 @@ export class BearerCredentialHandler implements ifm.RequestHandler {
|
||||
}
|
||||
|
||||
export class PersonalAccessTokenCredentialHandler
|
||||
implements ifm.RequestHandler
|
||||
{
|
||||
implements ifm.RequestHandler {
|
||||
token: string
|
||||
|
||||
constructor(token: string) {
|
||||
|
||||
@@ -519,7 +519,7 @@ export class HttpClient {
|
||||
handleResult(new Error(`Request timeout: ${info.options.path}`))
|
||||
})
|
||||
|
||||
req.on('error', function (err) {
|
||||
req.on('error', function(err) {
|
||||
// err has statusCode property
|
||||
// res should have headers
|
||||
handleResult(err)
|
||||
@@ -530,7 +530,7 @@ export class HttpClient {
|
||||
}
|
||||
|
||||
if (data && typeof data !== 'string') {
|
||||
data.on('close', function () {
|
||||
data.on('close', function() {
|
||||
req.end()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user