-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
27d03c8
commit 88e1813
Showing
9 changed files
with
390 additions
and
38,880 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using Microsoft.Extensions.FileProviders; | ||
using Microsoft.Extensions.Primitives; | ||
|
||
namespace GraphiQl | ||
{ | ||
internal class AssetProvider : IFileProvider | ||
{ | ||
private readonly EmbeddedFileProvider _provider; | ||
|
||
public AssetProvider(EmbeddedFileProvider provider) | ||
=> _provider = provider; | ||
|
||
public IFileInfo GetFileInfo(string subpath) | ||
{ | ||
// Embedded resource renames hypphens in directory to underscore, this tells file provider where to find it. | ||
if (subpath.Equals("/es6-promise/es6-promise.min.js", StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
subpath = "/es6_promise/es6-promise.min.js"; | ||
} | ||
|
||
return _provider.GetFileInfo(subpath); | ||
} | ||
|
||
public IDirectoryContents GetDirectoryContents(string subpath) | ||
=> _provider.GetDirectoryContents(subpath); | ||
|
||
public IChangeToken Watch(string filter) | ||
=> _provider.Watch(filter); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Binary file not shown.
Oops, something went wrong.