Skip to content

Commit 112d810

Browse files
ci: apply automated fixes
1 parent d35097c commit 112d810

2 files changed

Lines changed: 6 additions & 11 deletions

File tree

‎packages/devtools-vite/src/utils.ts‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,7 @@ export const handleDevToolsViteRequest = (
5454
})
5555
}
5656

57-
export const parseOpenSourceParam = (
58-
source: string,
59-
) => {
57+
export const parseOpenSourceParam = (source: string) => {
6058
// Capture everything up to the last two colon-separated numeric parts as the file.
6159
// This supports filenames that may themselves contain colons.
6260
const parts = source.match(/^(.+):(\d+):(\d+)$/)
@@ -87,4 +85,3 @@ export const tryParseJson = (jsonString: string) => {
8785
return null
8886
}
8987
} */
90-

‎packages/devtools-vite/tests/utils.test.ts‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ describe('handleDevToolsViteRequest', () => {
110110

111111
// simulate streaming body
112112
const chunks = [Buffer.from('{"foo":'), Buffer.from('1}')]
113-
;(req).emit('data', chunks[0])
114-
;(req).emit('data', chunks[1])
115-
;(req).emit('end')
113+
req.emit('data', chunks[0])
114+
req.emit('data', chunks[1])
115+
req.emit('end')
116116

117117
expect(cb).toHaveBeenCalledTimes(1)
118118
expect(cb).toHaveBeenCalledWith({ foo: 1 })
@@ -129,9 +129,8 @@ describe('handleDevToolsViteRequest', () => {
129129
const res = createMockRes()
130130

131131
handleDevToolsViteRequest(req, res as any, next as any, cb as any)
132-
133-
;(req).emit('data', Buffer.from('{ invalid json'))
134-
;(req).emit('end')
132+
req.emit('data', Buffer.from('{ invalid json'))
133+
req.emit('end')
135134

136135
expect(cb).not.toHaveBeenCalled()
137136
expect(res.write).toHaveBeenCalledWith('OK')
@@ -151,4 +150,3 @@ describe('parseOpenSourceParam', () => {
151150
expect(parsed).toEqual({ file: 'bar:baz.tsx', line: '3', column: '7' })
152151
})
153152
})
154-

0 commit comments

Comments
 (0)