react-native-fs
react-native-fs copied to clipboard
fix: StatResult ctime type
This pull request fixes ctime type which is, in fact, a Date value, as evidenced in the stat implementation method:
- https://github.com/itinance/react-native-fs/blob/master/FS.common.js#L306C17-L306C17
type StatResult = {
name: ?string;
path: string;
size: string;
mode: number;
ctime: number; // <-- Invalid type as shown in below stat method
};
// ...
stat(filepath: string): Promise<StatResult> {
return RNFSManager.stat(normalizeFilePath(filepath)).then((result) => {
return {
'path': filepath,
'ctime': new Date(result.ctime * 1000), // <-- ctime is a Date type, not a number
...
};
});
}