-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Consistent validation of dates/timestamps #191
Comments
Yeah, I was also trying to make this stuff more consistent. I think if |
@erikkemperman what is the status of this? I'm assuming it will end up in vinyl-prepare, right? |
Yeah, if I remember correctly I had branches off vinyl-fs and vinyl-prepare to separate I still have those branches if you'd like to take a look. I'm on my phone now but can look them up later. Apologies for leaving this hanging, between an extended stay in Sicily (ah, the food!), a new GF, and insane deadlines at work, this sort of fell overboard. |
https://github.com/erikkemperman/vinyl-prepare/commits/refactor-prepare-read https://github.com/erikkemperman/vinyl-fs/commits/refactor-prepare-read Probably needs rebasing but maybe better if you check first if it's going the right direction. The discussion we had on this is mostly here: https://github.com/gulpjs/vinyl-prepare/issues/4 And yes, this issue with inconsistent date/time handling would be addressed by earlier work on value-or-function and using that throughout. |
Looking at possibly cleaning up options processing a little, it seems to me that handling of dates/timestamps could perhaps be done with more consistency:
since
option checked by the value-or-function module (which just checks for type, not accounting for NaN or Infinite or invalid Date objects; https://github.com/gulpjs/value-or-function/blob/master/index.js#L54) and is then handled by a function in filter-since.js (https://github.com/gulpjs/vinyl-fs/blob/master/lib/filter-since.js#L6) which does the same check again.atime
andmtime
properties onfile.stat
are currently checked by an external module vali-date which only accepts strings (even thoughfs.Stats
expects them to be Date objects, and I would argue numbers and Numbers should work as well; https://github.com/SamVerschueren/vali-date/blob/master/index.js#L3).Would it make sense to make value-or-function more robust in this sense and then using that across the board?
(Edited to add some links)
The text was updated successfully, but these errors were encountered: