File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const getattr: (backend: SQLiteBackend) => MountOptions["getattr"] = (
10
10
11
11
if ( backend . isVirtualFile ( path ) ) {
12
12
const virtualFile = backend . getVirtualFile ( path ) ;
13
- cb ( 0 , virtualFile . getAttr ( ) ) ;
13
+ cb ( 0 , virtualFile . attr ) ;
14
14
return ;
15
15
}
16
16
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export const read: (backend: SQLiteBackend) => MountOptions["read"] = (
10
10
11
11
if ( backend . isVirtualFile ( path ) ) {
12
12
const virtualFile = backend . getVirtualFile ( path ) ;
13
- const bufChunk = virtualFile . getBuffer ( ) ;
13
+ const bufChunk = virtualFile . buffer ;
14
14
buf . write ( bufChunk . toString ( "binary" ) , "binary" ) ;
15
15
cb ( Buffer . byteLength ( bufChunk ) ) ;
16
16
return ;
Original file line number Diff line number Diff line change @@ -14,23 +14,23 @@ export class VirtualFile {
14
14
return this . _fileId ;
15
15
}
16
16
17
- getBuffer ( ) {
17
+ get buffer ( ) {
18
18
return Buffer . from ( this . _content ) ;
19
19
}
20
20
21
- getSize ( ) {
22
- return Buffer . byteLength ( this . getBuffer ( ) ) ;
21
+ get size ( ) {
22
+ return Buffer . byteLength ( this . buffer ) ;
23
23
}
24
24
25
- getAttr ( ) {
25
+ get attr ( ) {
26
26
return {
27
27
mtime : this . _date ,
28
28
atime : this . _date ,
29
29
ctime : this . _date ,
30
30
blocks : 1 ,
31
31
ino : this . fileId ,
32
32
nlink : 1 ,
33
- size : this . getSize ( ) ,
33
+ size : this . size ,
34
34
mode : 33188 ,
35
35
uid : process . getuid ? process . getuid ( ) : 0 ,
36
36
gid : process . getgid ? process . getgid ( ) : 0 ,
You can’t perform that action at this time.
0 commit comments