Skip to content

Commit

Permalink
feat: export OverlayFileSystemProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean authored and CGNonofr committed Apr 18, 2024
1 parent 1cadd7c commit df27332
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/service-override/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,9 @@ class OverlayFileSystemProvider implements IFileSystemProviderWithFileReadWriteC
capabilities = FileSystemProviderCapabilities.FileReadWrite | FileSystemProviderCapabilities.PathCaseSensitive

private async readFromDelegates<T> (caller: (delegate: IFileSystemProviderWithFileReadWriteCapability) => Promise<T>) {
if (this.delegates.length === 0) {
throw createFileSystemProviderError('No delegate', FileSystemProviderErrorCode.Unavailable)
}
let firstError: unknown | undefined
for (const delegate of this.delegates) {
try {
Expand All @@ -325,6 +328,9 @@ class OverlayFileSystemProvider implements IFileSystemProviderWithFileReadWriteC
}

private async writeToDelegates (caller: (delegate: IFileSystemProviderWithFileReadWriteCapability) => Promise<void>): Promise<void> {
if (this.delegates.length === 0) {
throw createFileSystemProviderError('No delegate', FileSystemProviderErrorCode.Unavailable)
}
for (const provider of this.delegates) {
if ((provider.capabilities & FileSystemProviderCapabilities.Readonly) > 0) {
continue
Expand Down Expand Up @@ -669,5 +675,6 @@ export {
RegisteredFile,
RegisteredReadOnlyFile,
RegisteredMemoryFile,
DelegateFileSystemProvider
DelegateFileSystemProvider,
OverlayFileSystemProvider
}

0 comments on commit df27332

Please sign in to comment.