Project updates from Template #1
@@ -10,6 +10,8 @@ public enum AssetExtension: String, CaseIterable, Sendable {
|
|||||||
case jpg
|
case jpg
|
||||||
/// A JavaScript file.
|
/// A JavaScript file.
|
||||||
case js
|
case js
|
||||||
|
/// An MPEG-4 video.
|
||||||
|
case mp4
|
||||||
/// A Portable Network Graphics image.
|
/// A Portable Network Graphics image.
|
||||||
case png
|
case png
|
||||||
/// A Scalable Vector Graphics image.
|
/// A Scalable Vector Graphics image.
|
||||||
@@ -20,6 +22,8 @@ public enum AssetExtension: String, CaseIterable, Sendable {
|
|||||||
case webmanifest
|
case webmanifest
|
||||||
/// A WebP image.
|
/// A WebP image.
|
||||||
case webp
|
case webp
|
||||||
|
/// A Web Open Font Format 2 font.
|
||||||
|
case woff2
|
||||||
/// An Extensible Markup Language file.
|
/// An Extensible Markup Language file.
|
||||||
case xml
|
case xml
|
||||||
}
|
}
|
||||||
@@ -37,11 +41,13 @@ public extension AssetExtension {
|
|||||||
case .ico: "image/vnd.microsoft.icon"
|
case .ico: "image/vnd.microsoft.icon"
|
||||||
case .jpg: "image/jpeg"
|
case .jpg: "image/jpeg"
|
||||||
case .js: "text/javascript"
|
case .js: "text/javascript"
|
||||||
|
case .mp4: "video/mp4"
|
||||||
case .png: "image/png"
|
case .png: "image/png"
|
||||||
case .svg: "image/svg+xml"
|
case .svg: "image/svg+xml"
|
||||||
case .txt: "text/plain"
|
case .txt: "text/plain"
|
||||||
case .webmanifest: "application/manifest+json"
|
case .webmanifest: "application/manifest+json"
|
||||||
case .webp: "image/webp"
|
case .webp: "image/webp"
|
||||||
|
case .woff2: "font/woff2"
|
||||||
case .xml: "application/xml"
|
case .xml: "application/xml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,8 +58,9 @@ public extension AssetExtension {
|
|||||||
case .css: "css"
|
case .css: "css"
|
||||||
case .js: "js"
|
case .js: "js"
|
||||||
case .jpg,
|
case .jpg,
|
||||||
.mp4,
|
.webp: "img"
|
||||||
.webp: "media"
|
case .mp4: "video"
|
||||||
|
case .woff2: "font"
|
||||||
default: nil
|
default: nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,38 +53,44 @@ private extension AssetExtensionTests {
|
|||||||
|
|
||||||
static let extensions: [AssetExtension] = [
|
static let extensions: [AssetExtension] = [
|
||||||
.css,
|
.css,
|
||||||
.js,
|
|
||||||
.png,
|
|
||||||
.jpg,
|
|
||||||
.webp,
|
|
||||||
.ico,
|
.ico,
|
||||||
|
.jpg,
|
||||||
|
.js,
|
||||||
|
.mp4,
|
||||||
|
.png,
|
||||||
.svg,
|
.svg,
|
||||||
.txt,
|
.txt,
|
||||||
.webmanifest,
|
.webmanifest,
|
||||||
|
.webp,
|
||||||
|
.woff2,
|
||||||
.xml
|
.xml
|
||||||
]
|
]
|
||||||
static let contentTypes: [String] = [
|
static let contentTypes: [String] = [
|
||||||
"text/css",
|
"text/css",
|
||||||
"text/javascript",
|
|
||||||
"image/png",
|
|
||||||
"image/jpeg",
|
|
||||||
"image/webp",
|
|
||||||
"image/vnd.microsoft.icon",
|
"image/vnd.microsoft.icon",
|
||||||
|
"image/jpeg",
|
||||||
|
"text/javascript",
|
||||||
|
"video/mp4",
|
||||||
|
"image/png",
|
||||||
"image/svg+xml",
|
"image/svg+xml",
|
||||||
"text/plain",
|
"text/plain",
|
||||||
"application/manifest+json",
|
"application/manifest+json",
|
||||||
|
"image/webp",
|
||||||
|
"font/woff2",
|
||||||
"application/xml"
|
"application/xml"
|
||||||
]
|
]
|
||||||
static let folders: [String?] = [
|
static let folders: [String?] = [
|
||||||
"css",
|
"css",
|
||||||
|
nil,
|
||||||
|
"img",
|
||||||
"js",
|
"js",
|
||||||
nil,
|
"video",
|
||||||
"media",
|
|
||||||
"media",
|
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
nil,
|
nil,
|
||||||
|
"img",
|
||||||
|
"font",
|
||||||
nil
|
nil
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user