Skip to content
This repository was archived by the owner on Apr 3, 2024. It is now read-only.

Commit d7bec41

Browse files
chore: Run gts fix and manually fix some errors (#369)
1 parent 1d300ac commit d7bec41

37 files changed

+1628
-1747
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/agent/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export interface StackdriverConfig extends common.AuthenticationConfig {
166166
debug?: DebugAgentConfig;
167167
}
168168

169-
const defaultConfig: DebugAgentConfig = {
169+
export const defaultConfig: DebugAgentConfig = {
170170
// FIXME(ofrobots): presently this is dependent what cwd() is at the time this
171171
// file is first required. We should make the default config static.
172172
workingDirectory: process.cwd(),
@@ -202,5 +202,3 @@ const defaultConfig: DebugAgentConfig = {
202202
forceNewAgent_: false,
203203
testMode_: false
204204
};
205-
206-
export default defaultConfig;

src/agent/controller.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,12 @@ export class Controller extends common.ServiceObject {
5858
uri: API + '/debuggees/register',
5959
method: 'POST',
6060
json: true,
61-
body: {debuggee: debuggee}
61+
body: {debuggee}
6262
};
6363
this.request(
6464
options,
65-
function(err: Error, body: any, response: http.ServerResponse) {
65+
(err: Error, body: {debuggee: Debuggee},
66+
response: http.ServerResponse) => {
6667
if (err) {
6768
callback(err);
6869
} else if (response.statusCode !== 200) {
@@ -98,8 +99,9 @@ export class Controller extends common.ServiceObject {
9899
const uri = API + '/debuggees/' + encodeURIComponent(debuggee.id) +
99100
'/breakpoints?' + qs.stringify(query);
100101
that.request(
101-
{uri: uri, json: true},
102-
function(err: Error, body: any, response: http.ServerResponse) {
102+
{uri, json: true},
103+
(err: Error, body: stackdriver.ListBreakpointsResponse,
104+
response: http.ServerResponse) => {
103105
if (!response) {
104106
callback(
105107
err || new Error('unknown error - request response missing'));
@@ -130,7 +132,7 @@ export class Controller extends common.ServiceObject {
130132
*/
131133
updateBreakpoint(
132134
debuggee: Debuggee, breakpoint: stackdriver.Breakpoint,
133-
callback: (err?: Error, body?: any) => void): void {
135+
callback: (err?: Error, body?: {}) => void): void {
134136
assert(debuggee.id, 'should have a registered debuggee');
135137

136138
breakpoint.action = 'CAPTURE';
@@ -141,15 +143,15 @@ export class Controller extends common.ServiceObject {
141143
'/breakpoints/' + encodeURIComponent(breakpoint.id as string),
142144
json: true,
143145
method: 'PUT',
144-
body: {debuggeeId: debuggee.id, breakpoint: breakpoint}
146+
body: {debuggeeId: debuggee.id, breakpoint}
145147
};
146148

147149
// We need to have a try/catch here because a JSON.stringify will be done
148150
// by request. Some V8 debug mirror objects get a throw when we attempt to
149151
// stringify them. The try-catch keeps it resilient and avoids crashing the
150152
// user's app.
151153
try {
152-
this.request(options, function(err: Error, body: any /*, response */) {
154+
this.request(options, (err: Error, body: {} /*, response */) => {
153155
callback(err, body);
154156
});
155157
} catch (error) {

0 commit comments

Comments
 (0)