@jsvfs/adapter-noop
Version:
The default adapter for `@jsvfs/core`.
33 lines • 1.3 kB
JavaScript
;
/**
* [[include:packages/adapter-noop/README.md]]
* @packageDocumentation
* @module @jsvfs/adapter-noop
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.NoopAdapter = void 0;
/** An adapter for No-Operation; essentially makes the VFS a memory-only instance. */
class NoopAdapter {
/** Creates an instance of noop adapter. */
constructor() {
this.root = '';
this.handle = 'noop';
this.journal = [];
}
/** Snapshot of the underlying file system; an asynchronous iterable which returns an entry of path and data.
* @returns {AsyncGenerator<[string, SnapshotEntry]>} The asynchronous iterable to get the snapshot.
*/
async *snapshot() { }
/** Create a file or write the contents of a file to persistent storage. */
async write(path, contents) { }
/** Make a directory or directory tree in persistent storage. */
async mkdir(path) { }
/** Create a link in persistent storage. */
async link(from, to, type) { }
/** Remove items from persistent storage. */
async remove(path, type) { }
/** Flush the underlying file system to prepare for a commit. */
async flush() { }
}
exports.NoopAdapter = NoopAdapter;
//# sourceMappingURL=index.js.map