core Image update

This commit is contained in:
tmshv committed 2017-05-25 22:36:37 +03:00
1 parent 51ea05cd61
commit c3676a02be
3 files changed
+62 -1

No files matched your search

+16
View File
@@ -31,6 +31,22 @@ function any(list) {
return list.reduce((t, i) => t || i, false)
}
/**
*
* {a: {}, b: {}, ...} -> Map (a: Class, b: Class)
*
* @param Class
* @param object
*/
function mapOf(Class, object) {
return Object
.entries(object)
.reduce((map, i) => (
map.set(i[0], new Class(i[1]))
), new Map())
}
exports.compose = compose
exports.all = all
exports.any = any
exports.mapOf = mapOf