Skip to content

Commit 12170ea

Browse files
committed
compile errors
1 parent bee258e commit 12170ea

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

browser-extension/tests/har-record.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function globToRegex(pattern: string): RegExp {
1515
// Filter pages based on pattern
1616
function filterPages(pattern: string) {
1717
const regex = globToRegex(pattern)
18-
return PAGES.filter(([name]) => regex.test(name))
18+
return Object.entries(PAGES).filter(([name]) => regex.test(name))
1919
}
2020

2121
const FILTER =
@@ -88,7 +88,7 @@ async function sanitize(filename: string) {
8888
// If no argument provided, show available keys
8989
if (!pattern) {
9090
console.log('Available recording targets:')
91-
for (const [name] of PAGES) {
91+
for (const [name] of Object.entries(PAGES)) {
9292
console.log(` ${name}`)
9393
}
9494
console.log('\nUsage: npm run har:record <pattern>')
@@ -105,7 +105,7 @@ async function sanitize(filename: string) {
105105
if (pagesToRecord.length === 0) {
106106
console.log(`No targets match pattern: ${pattern}`)
107107
console.log('Available targets:')
108-
for (const [name] of PAGES) {
108+
for (const [name] of Object.entries(PAGES)) {
109109
console.log(` ${name}`)
110110
}
111111
return

browser-extension/tests/har-view.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ async function loadHar(filename: string) {
6363
}
6464

6565
// List available HAR files
66-
app.get('/', async (req, res) => {
66+
app.get('/', async (_req, res) => {
6767
try {
6868
const harDir = path.join(__dirname, 'har')
6969
const files = await fs.readdir(harDir)
@@ -168,10 +168,10 @@ app.get('/page/:filename', async (req, res) => {
168168
`/asset/${filename.replace('.har', '')}`,
169169
)
170170

171-
res.send(html)
171+
return res.send(html)
172172
} catch (error) {
173173
console.error('Error serving page:', error)
174-
res.status(500).send('Error loading page')
174+
return res.status(500).send('Error loading page')
175175
}
176176
})
177177

@@ -270,10 +270,10 @@ app.get('/page/:filename/gitcasso', async (req, res) => {
270270
html += contentScriptTag
271271
}
272272

273-
res.send(html)
273+
return res.send(html)
274274
} catch (error) {
275275
console.error('Error serving page:', error)
276-
res.status(500).send('Error loading page')
276+
return res.status(500).send('Error loading page')
277277
}
278278
})
279279

@@ -301,13 +301,13 @@ app.get('/asset/:harname/*', async (req, res) => {
301301
res.set('Content-Type', mimeType)
302302

303303
if (content.encoding === 'base64') {
304-
res.send(Buffer.from(content.text, 'base64'))
304+
return res.send(Buffer.from(content.text, 'base64'))
305305
} else {
306-
res.send(content.text || '')
306+
return res.send(content.text || '')
307307
}
308308
} catch (error) {
309309
console.error('Error serving asset:', error)
310-
res.status(404).send('Asset not found')
310+
return res.status(404).send('Asset not found')
311311
}
312312
})
313313

0 commit comments

Comments
 (0)