mirror of
https://github.com/purocean/yn.git
synced 2026-08-30 17:47:18 +08:00
refactor: improve file extension checking logic
This commit is contained in:
@@ -154,7 +154,9 @@ const extensions = [
|
||||
]
|
||||
|
||||
const supported = (name: string) => {
|
||||
return extensions.includes(extname(name.toLowerCase()))
|
||||
name = name.toLowerCase()
|
||||
const ext = extname(name) || name.startsWith('.') ? name : ''
|
||||
return ext ? extensions.includes(ext) : false
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
Reference in New Issue
Block a user