Created
September 29, 2014 23:15
-
-
Save MylesBorins/ff70649de370c2c21ed6 to your computer and use it in GitHub Desktop.
Examples Path Reduce
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var output = _.groupBy(examples, function (file) { | |
return file.split('/')[0]; | |
}); | |
output = _.reduce(output, function (result, folder, key) { | |
result[key] = _.groupBy(folder, function (file) { | |
return path.dirname(file); | |
}); | |
return result; | |
}, {}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I do not at all remember the context of this