Skip to content

Commit d7b83b1

Browse files
committed
changed type syntax
1 parent a98b799 commit d7b83b1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

js/src/sandbox.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ export class Sandbox extends BaseSandbox {
220220
}, requestTimeout)
221221
: undefined
222222

223-
const headers = {
223+
const headers: Record<string, string> = {
224224
'Content-Type': 'application/json',
225-
} as Record<string, string>
225+
}
226226

227227
if (this.trafficAccessToken) {
228228
headers['E2B-Traffic-Access-Token'] = this.trafficAccessToken
@@ -300,10 +300,10 @@ export class Sandbox extends BaseSandbox {
300300
*/
301301
async createCodeContext(opts?: CreateCodeContextOpts): Promise<Context> {
302302
try {
303-
const headers = {
303+
const headers: Record<string, string> = {
304304
'Content-Type': 'application/json',
305305
...this.connectionConfig.headers,
306-
} as Record<string, string>
306+
}
307307

308308
if (this.trafficAccessToken) {
309309
headers['E2B-Traffic-Access-Token'] = this.trafficAccessToken
@@ -341,10 +341,10 @@ export class Sandbox extends BaseSandbox {
341341
async removeCodeContext(context: Context | string): Promise<void> {
342342
try {
343343
const id = typeof context === 'string' ? context : context.id
344-
const headers = {
344+
const headers: Record<string, string> = {
345345
'Content-Type': 'application/json',
346346
...this.connectionConfig.headers,
347-
} as Record<string, string>
347+
}
348348

349349
if (this.trafficAccessToken) {
350350
headers['E2B-Traffic-Access-Token'] = this.trafficAccessToken
@@ -411,10 +411,10 @@ export class Sandbox extends BaseSandbox {
411411
async restartCodeContext(context: Context | string): Promise<void> {
412412
try {
413413
const id = typeof context === 'string' ? context : context.id
414-
const headers = {
414+
const headers: Record<string, string> = {
415415
'Content-Type': 'application/json',
416416
...this.connectionConfig.headers,
417-
} as Record<string, string>
417+
}
418418

419419
if (this.trafficAccessToken) {
420420
headers['E2B-Traffic-Access-Token'] = this.trafficAccessToken

0 commit comments

Comments
 (0)