-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnull.ts
22 lines (21 loc) · 809 Bytes
/
null.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import type { FileSystemDriver, FileSystemNode } from './index';
export class NullFS implements FileSystemDriver {
async resolveUri(path: string[]): Promise<string> {
throw new Error('EACCESS');
}
async access(path: string[]): Promise<boolean> {
return false;
}
async readDir(path: string[]): Promise<ReadableStream<FileSystemNode>> {
throw new Error('EACCESS');
}
async readFile(path: string[], offset?: number, length?: number): Promise<ReadableStream<Uint8Array>> {
throw new Error('EACCESS');
}
async writeFile(path: string[], offset: 'before' | 'after' | 'override', create: boolean): Promise<WritableStream<Uint8Array>> {
throw new Error('EACCESS');
}
async deleteNode(path: string[], recursive: boolean): Promise<void> {
throw new Error('EACCESS');
}
}