@@ -23,7 +23,7 @@ import { DirectoryEntry, FileSystem } from './file-system';
23
23
export class DevkitFileSystem extends FileSystem {
24
24
private _updateRecorderCache = new Map < string , UpdateRecorder > ( ) ;
25
25
26
- constructor ( private _tree : Tree ) {
26
+ constructor ( readonly tree : Tree ) {
27
27
super ( ) ;
28
28
}
29
29
@@ -36,13 +36,13 @@ export class DevkitFileSystem extends FileSystem {
36
36
if ( this . _updateRecorderCache . has ( filePath ) ) {
37
37
return this . _updateRecorderCache . get ( filePath ) as UpdateRecorder ;
38
38
}
39
- const recorder = this . _tree . beginUpdate ( filePath ) ;
39
+ const recorder = this . tree . beginUpdate ( filePath ) ;
40
40
this . _updateRecorderCache . set ( filePath , recorder ) ;
41
41
return recorder ;
42
42
}
43
43
44
44
commitEdits ( ) {
45
- this . _updateRecorderCache . forEach ( ( r ) => this . _tree . commitUpdate ( r ) ) ;
45
+ this . _updateRecorderCache . forEach ( ( r ) => this . tree . commitUpdate ( r ) ) ;
46
46
this . _updateRecorderCache . clear ( ) ;
47
47
}
48
48
@@ -51,7 +51,7 @@ export class DevkitFileSystem extends FileSystem {
51
51
// directory exists. It throws a specific error though if a directory
52
52
// is being read as a file. We use that to check if a directory exists.
53
53
try {
54
- return this . _tree . get ( fileOrDirPath ) !== null ;
54
+ return this . tree . get ( fileOrDirPath ) !== null ;
55
55
} catch ( e ) {
56
56
if ( e instanceof PathIsDirectoryException ) {
57
57
return true ;
@@ -61,25 +61,25 @@ export class DevkitFileSystem extends FileSystem {
61
61
}
62
62
63
63
overwrite ( filePath : Path , content : string ) {
64
- this . _tree . overwrite ( filePath , content ) ;
64
+ this . tree . overwrite ( filePath , content ) ;
65
65
}
66
66
67
67
create ( filePath : Path , content : string ) {
68
- this . _tree . create ( filePath , content ) ;
68
+ this . tree . create ( filePath , content ) ;
69
69
}
70
70
71
71
delete ( filePath : Path ) {
72
- this . _tree . delete ( filePath ) ;
72
+ this . tree . delete ( filePath ) ;
73
73
}
74
74
75
75
read ( filePath : Path ) {
76
- const buffer = this . _tree . read ( filePath ) ;
76
+ const buffer = this . tree . read ( filePath ) ;
77
77
return buffer !== null ? buffer . toString ( ) : null ;
78
78
}
79
79
80
80
readDirectory ( dirPath : Path ) : DirectoryEntry {
81
81
try {
82
- const { subdirs : directories , subfiles : files } = this . _tree . getDir (
82
+ const { subdirs : directories , subfiles : files } = this . tree . getDir (
83
83
dirPath
84
84
) ;
85
85
return { directories, files } ;
0 commit comments