mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-19 09:33:53 +00:00
fix(core): Treat .mts files as TypeScript modules instead of video files (#5492)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -122,9 +122,10 @@ export async function detectFileType(
|
||||
): Promise<'text' | 'image' | 'pdf' | 'audio' | 'video' | 'binary' | 'svg'> {
|
||||
const ext = path.extname(filePath).toLowerCase();
|
||||
|
||||
// The mimetype for "ts" is MPEG transport stream (a video format) but we want
|
||||
// to assume these are typescript files instead.
|
||||
if (ext === '.ts') {
|
||||
// The mimetype for various TypeScript extensions (ts, mts, cts, tsx) can be
|
||||
// MPEG transport stream (a video format), but we want to assume these are
|
||||
// TypeScript files instead.
|
||||
if (['.ts', '.mts', '.cts'].includes(ext)) {
|
||||
return 'text';
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user