mirror of
https://github.com/Nezumi-2711/onedrive-vercel-index.git
synced 2026-09-22 20:01:46 +00:00
Preserve original ext and skip folders when extracting extensions (#448)
This commit is contained in:
@@ -105,8 +105,11 @@ export function hasKey<O>(obj: O, key: PropertyKey): key is keyof O {
|
||||
return key in obj
|
||||
}
|
||||
|
||||
export function getRawExtension(fileName: string): string {
|
||||
return fileName.slice(((fileName.lastIndexOf('.') - 1) >>> 0) + 2)
|
||||
}
|
||||
export function getExtension(fileName: string): string {
|
||||
return fileName.slice(((fileName.lastIndexOf('.') - 1) >>> 0) + 2).toLowerCase()
|
||||
return getRawExtension(fileName).toLowerCase()
|
||||
}
|
||||
|
||||
export function getFileIcon(fileName: string, flags?: { video?: boolean }): [IconPrefix, IconName] {
|
||||
|
||||
Reference in New Issue
Block a user