mapOf moved to server lib

This commit is contained in:
tmshv committed 2019-08-05 17:25:51 +03:00
1 parent 04db0114e7
commit 94d06aa8cd
3 files changed
+15 -17

No files matched your search

-16
View File
@@ -31,22 +31,6 @@ 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