Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use correct type for stat size #1048

Merged
merged 1 commit into from
Feb 18, 2022
Merged

Conversation

manuelbieh
Copy link
Contributor

@manuelbieh manuelbieh commented Oct 20, 2021

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?

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?
@itinance itinance merged commit 82b339f into itinance:master Feb 18, 2022
@Ceiridge
Copy link

Ceiridge commented Mar 8, 2022

size is still a string here:

size: string; // Size in bytes
isFile: () => boolean; // Is the file just a file?
isDirectory: () => boolean; // Is the file a directory?
};
type StatResult = {
name: ?string; // The name of the item TODO: why is this not documented?
path: string; // The absolute path to the item
size: string; // Size in bytes

Is this intentional?
@itinance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants