-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
add number of reversions option #3
Conversation
26a3bbd
to
7dadbdb
Compare
return through.obj(function (file, enc, cb) { | ||
var history = file.history; | ||
|
||
if (history.length > 1) { | ||
if (history.length > reversions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should just silently not do its thing when there aren't enough history. Either throw or reverse as much as possible. Not sure which.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverse as much as possible? Since it's backward compatible any no one raised a request on throwing an error before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I think it makes more sense now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverse as much as possible?
👍
7dadbdb
to
0189276
Compare
gulpjs/vinyl-fs#77 is merged and the added tests gulpjs/vinyl-fs#79 passed. We could use double |
👍 |
@@ -1,15 +1,19 @@ | |||
'use strict'; | |||
var through = require('through2'); | |||
|
|||
module.exports = function () { | |||
module.exports = function (reversions) { | |||
reversions = reversions || 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reversions = typeof reversions === 'number' ? reversions : 1;
as users might want to explicitly pass in 0
for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should also have an empty line below this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very true
04f7513
to
295e33a
Compare
double dest example needs to wait until |
Looks good. Thanks :) |
Ref: sindresorhus/vinyl-paths#2
Only thing is its probably not the best use-case to demonstrate in the README.md. However I can't use double
dest
because thebase
would change in after the firstdest()
. gulpjs/vinyl-fs#77