diff --git a/src/Vite.AspNetCore.Abstractions/IViteManifest.cs b/src/Vite.AspNetCore.Abstractions/IViteManifest.cs index f8beb76..01f9d5b 100644 --- a/src/Vite.AspNetCore.Abstractions/IViteManifest.cs +++ b/src/Vite.AspNetCore.Abstractions/IViteManifest.cs @@ -15,4 +15,17 @@ public interface IViteManifest : IEnumerable /// /// The chunk if it exists, otherwise . IViteChunk? this[string key] { get; } -} \ No newline at end of file + + /// + /// Gets an enumerable collection that contains the chunk keys in the manifest. + /// + /// An enumerable collection that contains the chunk keys in the manifest. + IEnumerable Keys { get; } + + /// + /// Determines whether the manifest contains a chunk with the specified key entry. + /// + /// The eky entry to locate. + /// true if the manifest contains a chunk with the specified key entry; otherwise, false. + bool ContainsKey(string key); +} diff --git a/src/Vite.AspNetCore/Services/ViteManifest.cs b/src/Vite.AspNetCore/Services/ViteManifest.cs index 5f2b202..8814957 100644 --- a/src/Vite.AspNetCore/Services/ViteManifest.cs +++ b/src/Vite.AspNetCore/Services/ViteManifest.cs @@ -139,6 +139,27 @@ public IViteChunk? this[string key] } } + /// + IEnumerator IEnumerable.GetEnumerator() + { + return this._chunks.Values.GetEnumerator(); + } + + /// + IEnumerator IEnumerable.GetEnumerator() + { + return this._chunks.Values.GetEnumerator(); + } + + /// + IEnumerable IViteManifest.Keys => this._chunks.Keys; + + /// + bool IViteManifest.ContainsKey(string key) + { + return this._chunks.ContainsKey(key); + } + /// /// Combines the specified URI and paths. /// @@ -154,16 +175,4 @@ private static string CombineUri(string uri, string path) return uri.EndsWith('/') ? uri + path : uri + "/" + path; } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return this._chunks.Values.GetEnumerator(); - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return this._chunks.Values.GetEnumerator(); - } }