Explicit asset property
This commit is contained in:
@ -8,7 +8,6 @@ enum FileTypeCategory: String, CaseIterable {
|
||||
case text
|
||||
case video
|
||||
case resource
|
||||
case asset
|
||||
case audio
|
||||
|
||||
var text: String {
|
||||
@ -18,7 +17,6 @@ enum FileTypeCategory: String, CaseIterable {
|
||||
case .model: return "Models"
|
||||
case .text: return "Text"
|
||||
case .video: return "Videos"
|
||||
case .asset: return "Assets"
|
||||
case .resource: return "Other"
|
||||
case .audio: return "Audio"
|
||||
}
|
||||
@ -32,7 +30,6 @@ enum FileTypeCategory: String, CaseIterable {
|
||||
case .text: .docText
|
||||
case .video: .video
|
||||
case .resource: .docZipper
|
||||
case .asset: .network
|
||||
case .audio: .speakerWave2CircleFill
|
||||
}
|
||||
}
|
||||
@ -67,6 +64,8 @@ enum FileType: String {
|
||||
|
||||
case tiff
|
||||
|
||||
case ico
|
||||
|
||||
// MARK: Code
|
||||
|
||||
case html
|
||||
@ -77,15 +76,9 @@ enum FileType: String {
|
||||
|
||||
case sh
|
||||
|
||||
// MARK: Assets
|
||||
|
||||
case css
|
||||
|
||||
case js
|
||||
|
||||
case ttf
|
||||
|
||||
case ico
|
||||
case css
|
||||
|
||||
// MARK: Text
|
||||
|
||||
@ -131,6 +124,8 @@ enum FileType: String {
|
||||
|
||||
case noExtension
|
||||
|
||||
case ttf
|
||||
|
||||
case zip
|
||||
|
||||
case cddx
|
||||
@ -163,21 +158,19 @@ enum FileType: String {
|
||||
|
||||
var category: FileTypeCategory {
|
||||
switch self {
|
||||
case .jpg, .png, .avif, .webp, .gif, .svg, .tiff:
|
||||
case .jpg, .png, .avif, .webp, .gif, .svg, .tiff, .ico:
|
||||
return .image
|
||||
case .mp4, .m4v, .webm:
|
||||
return .video
|
||||
case .mp3, .aac, .m4b, .m4a:
|
||||
return .audio
|
||||
case .js, .css, .ttf, .ico:
|
||||
return .asset
|
||||
case .json, .conf, .yaml, .txt:
|
||||
return .text
|
||||
case .html, .cpp, .swift, .sh:
|
||||
case .html, .cpp, .swift, .sh, .js, .css:
|
||||
return .code
|
||||
case .stl, .f3d, .step, .glb, .f3z:
|
||||
return .model
|
||||
case .zip, .cddx, .pdf, .key, .psd:
|
||||
case .zip, .cddx, .pdf, .key, .psd, .ttf:
|
||||
return .resource
|
||||
case .noExtension, .unknown:
|
||||
return .resource
|
||||
@ -213,8 +206,11 @@ enum FileType: String {
|
||||
category == .audio
|
||||
}
|
||||
|
||||
var isAsset: Bool {
|
||||
category == .asset
|
||||
var isLikelyAssetType: Bool {
|
||||
switch self {
|
||||
case .js, .css, .ttf, .ico: true
|
||||
default: false
|
||||
}
|
||||
}
|
||||
|
||||
var isTextFile: Bool {
|
||||
|
Reference in New Issue
Block a user