Skip to content

Commit 136bf28

Browse files
authored
fix: use correct type for stat size
Hey. I console.log'd a list of files I got from `fs.readDir()` and to me it looks like the size property is of type `number`, not `string`: ``` { "ctime": "2021-10-19T16:02:30.807Z", "mtime": "2021-10-19T16:02:35.146Z", "name": "B1979F99-6369-4036-8476-B6D14E653B0E.mp4", "path": "/private/var/mobile/Containers/Data/Application/0CE5748F-79A8-4120-B366-C92E6E0C6D17/tmp/ReactNative/B1979F99-6369-4036-8476-B6D14E653B0E.mp4", "size": 34234799, } ``` Could you please check and verify/falsify that?
1 parent 146e7fb commit 136bf28

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ type ReadDirItem = {
1212
mtime: Date | undefined // The last modified date of the file
1313
name: string // The name of the item
1414
path: string // The absolute path to the item
15-
size: string // Size in bytes
15+
size: number // Size in bytes
1616
isFile: () => boolean // Is the file just a file?
1717
isDirectory: () => boolean // Is the file a directory?
1818
}
1919

2020
type StatResult = {
2121
name: string | undefined // The name of the item TODO: why is this not documented?
2222
path: string // The absolute path to the item
23-
size: string // Size in bytes
23+
size: number // Size in bytes
2424
mode: number // UNIX file mode
2525
ctime: number // Created date
2626
mtime: number // Last modified date

0 commit comments

Comments
 (0)