Closed niksy closed 8 years ago
@niksy, Thanks for the PR. I think it's better to add the filename of stylesheet as a property to Image
object. The reason for this is to have fewer arguments that are passed to filterBy
& groupBy
functions.
What's your opinion about this?
That could work! Something along the lines originatingFile
? Do you want me to update the PR or would you like to deal with this?
OK, I’ve updated the PR, it seems like we already have declaration for that, styleFilePath
, so I’ve used that for object property and value.
Currenty, only image object is argument for
groupBy
callback, but having access to additional properties such as currently processed file and it’s name is useful for situations where you would like to group sprites based on CSS filename or if one file uses same icon from other file and your grouping method allows them to override already existing file.To make it consistent, adding same rule for
filterBy
would also be nice.