Skip to content

Instantly share code, notes, and snippets.

View ozzyr's full-sized avatar
🎯
Focusing

Ozzyr ozzyr

🎯
Focusing
  • Itapecerica da serra
View GitHub Profile
@ozzyr
ozzyr / groupBy.js
Created June 29, 2020 15:25 — forked from suissa/groupBy.js
Group by bem facinho
const groupBy = (xs, key) => xs.reduce((rv, x) => ({
...rv, [x[key]]: [...(rv[x[key]] || []), x]
}), {});
@ozzyr
ozzyr / groupBy.js
Created June 29, 2020 15:25 — forked from suissa/groupBy.js
Group by bem facinho
const groupBy = (xs, key) => xs.reduce((rv, x) => ({
...rv, [x[key]]: [...(rv[x[key]] || []), x]
}), {});
@ozzyr
ozzyr / .js
Created August 15, 2018 16:34
const fs = require('fs');
const path = require('path');
module.exports = app => {
fs
.readdirSync(__dirname)
.filter(file => ((file.indexOf('.')) !== 0 && (file !== "index.js")))
.forEach(file => require(path.resolve(__dirname, file))(app));
}