-
Notifications
You must be signed in to change notification settings - Fork 9
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
Pass arguments to tmp
#8
Conversation
return module.exports.file.apply(tmp).then(function context(o) { | ||
|
||
var params = Array.prototype.slice.call(arguments); | ||
params.shift(); |
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.
Are you sure this should be shift
? Also, I'm wondering if it's not enough to do Array.from
rather than Array.slice.call here.
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.
.shift()
remove the first entry from the array, in this case the fn
. We can use instead .slice(1)
if it's cleaner, and now that I think about it, we are already using .slice()
, hum...
Yes, we could use Array.from()
, it's just that I always forgot about it, I'm too much used to the .slice()
hack :-P
@@ -0,0 +1,53 @@ | |||
const accessSync = require('fs').accessSync |
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.
Using const
here means we can't run the tests on older node. a nitpick but I deliberately avoided ES2015 features to keep old node uspport.
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.
Fair enought, I'll change it. Are you planning to use Travis for the tests or something? I could be able to configure it, but don't know if I would need permissions on the repo...
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 was planning on just running them manually at each go. I don't think I release often enough to require CI/CD.
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.
Well, it's good to have them just for the badge, too... :-P
Code updated with your suggested changes. |
Thanks, I'll do a release when I'm back from holiday. |
No description provided.