Skip to content

Commit

Permalink
Changed registerBackend and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
james-pre committed Oct 12, 2023
1 parent 5aa1655 commit 5b342e8
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/backends/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,14 @@ import { InMemoryFileSystem as InMemory } from './InMemory';
import { OverlayFS } from './OverlayFS';
import { BackendConstructor } from './backend';

export const backends: { [backend: string]: BackendConstructor } = {
AsyncMirror,
FolderAdapter,
InMemory,
OverlayFS,
};
export const backends: { [backend: string]: BackendConstructor } = {};
export default backends;
export { AsyncMirror, FolderAdapter, InMemory, OverlayFS };

export function registerBackend(name: string, fs: BackendConstructor) {
backends[name] = fs;
export function registerBackend(..._backends: BackendConstructor[]) {
for (const backend of _backends) {
backends[backend.Name] = backend;
}
}

registerBackend(AsyncMirror, FolderAdapter, InMemory, OverlayFS);

0 comments on commit 5b342e8

Please sign in to comment.