1
1
mirror of https://github.com/primer/css.git synced 2025-01-06 05:33:07 +03:00
css/lib/filter-by.js
2019-02-04 12:55:18 -08:00

11 lines
223 B
JavaScript

module.exports = function filterBy(fn) {
return (files, metal, done) => {
for (const [key, file] of Object.entries(files)) {
if (!fn(file, key, metal)) {
delete files[key]
}
}
done()
}
}