MCPcopy Index your code
hub / github.com/ColmapView/Colmapview.github.io / TestFileSystemDirectoryEntry

Class TestFileSystemDirectoryEntry

src/test/builders/fileFakes.ts:127–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127class TestFileSystemDirectoryEntry extends TestFileSystemEntry implements FileSystemDirectoryEntry {
128 private readonly entryBatches: FileSystemEntry[][];
129
130 constructor(
131 name: string,
132 entryBatches: FileSystemEntry[][] = [[]],
133 ) {
134 super(name, false, true);
135 this.entryBatches = entryBatches;
136 }
137
138 createReader(): FileSystemDirectoryReader {
139 let readIndex = 0;
140
141 return {
142 readEntries: (successCallback: FileSystemEntriesCallback) => {
143 successCallback(this.entryBatches[readIndex++] ?? []);
144 },
145 };
146 }
147
148 getDirectory(
149 _path?: string | null,
150 _options?: FileSystemFlags,
151 _successCallback?: FileSystemEntryCallback,
152 errorCallback?: ErrorCallback,
153 ): void {
154 errorCallback?.(new DOMException('Directory lookup is not implemented by this test fake', 'NotFoundError'));
155 }
156
157 getFile(
158 _path?: string | null,
159 _options?: FileSystemFlags,
160 _successCallback?: FileSystemEntryCallback,
161 errorCallback?: ErrorCallback,
162 ): void {
163 errorCallback?.(new DOMException('File lookup is not implemented by this test fake', 'NotFoundError'));
164 }
165}
166
167class TestFileSystemFileHandle implements FileSystemFileHandle {
168 readonly kind = 'file';

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected