To make use files option as string path#40
To make use files option as string path#40zemd wants to merge 1 commit intog13013:masterfrom zemd:patch-1
Conversation
If there is only one file to compile, it is useful to omit array notation
There was a problem hiding this comment.
This can lead to have an array of array !
Change it to: options.files = [].concat(options.files);
There was a problem hiding this comment.
No, it doesn't lead to that.
// input
[].concat([["hello", "world"]])
// output
// [ Array(2) ]//input
[].concat.apply([], [["hello", "world"]] )
// output
// ["hello", "world"]There was a problem hiding this comment.
You are right 👍, but sorry to insist, I prefer to change it to a simpler form, it confused me, so it will do with others :)
This line will be enough: options.files = options.files && [].concat(options.files) || [];
There was a problem hiding this comment.
Your solution also nice, but first you should validate existence of options.files.length to include only array and string.
so it will be:
options.files = options.files && options.files.length && [].concat(options.files) || [];There was a problem hiding this comment.
Sounds very good for me, go ahead 👍
There was a problem hiding this comment.
could you make the changes ? or I merge and modify my self ?
If there is only one file to compile, it is useful to omit array notation