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

doc: fix type of atime/mtime #29666

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions doc/api/fs.md
Original file line number Diff line number Diff line change
Expand Up @@ -2086,8 +2086,8 @@ changes:
-->

* `fd` {integer}
* `atime` {integer}
* `mtime` {integer}
* `atime` {number|string|Date}
* `mtime` {number|string|Date}

Synchronous version of [`fs.futimes()`][]. Returns `undefined`.

Expand Down Expand Up @@ -3462,8 +3462,8 @@ changes:
-->

* `path` {string|Buffer|URL}
* `atime` {integer}
* `mtime` {integer}
* `atime` {number|string|Date}
* `mtime` {number|string|Date}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to keep integer instead of number. We might want to have a stricter validation here at some point. I am not sure what the behavior would be in case a decimal is used instead of an integer.

Copy link
Contributor Author

@exoego exoego Sep 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that there is no validation nor rounding, so decimal will be used as decimal.

if (Number.isFinite(time)) {
if (time < 0) {
return Date.now() / 1000;
}
return time;
}

Are these supposed to be integer?
Updated so in 019b628

Copy link
Member

@lpinca lpinca Sep 27, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case I think number is more appropriate. Sorry for the trouble.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 22157ef


Returns `undefined`.

Expand Down