mirror of
https://github.com/bellingcat/ukraine-timemap.git
synced 2026-06-12 13:28:36 +03:00
restructure overlay
This commit is contained in:
@@ -136,3 +136,18 @@ export function toggleFlagAC (flag) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function selectTypeFromPath (path) {
|
||||
let type
|
||||
switch (true) {
|
||||
case /\.(png|jpg)$/.test(path):
|
||||
type = 'Image'; break
|
||||
case /\.(mp4)$/.test(path):
|
||||
type = 'Video'; break
|
||||
case /\.(md)$/.test(path):
|
||||
type = 'Text'; break
|
||||
default:
|
||||
type = 'Unknown'; break
|
||||
}
|
||||
return { type, path }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user