Skip to content

Conversation

n-kulic
Copy link

@n-kulic n-kulic commented Nov 2, 2023

This pull request fixes ctime type which is, in fact, a Date value, as evidenced in the stat implementation method:

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
      ...
    };
  });
}

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.

1 participant