api drop unused code

This commit is contained in:
tmshv committed 2020-03-03 01:33:17 +03:00
1 parent d859fdb302
commit 06745b45f4
26 files changed
+32 -788

No files matched your search

+15 -1
View File
@@ -1,9 +1,23 @@
import Data from './Data'
import ImageArtifactType from './ImageArtifactType'
import { findOne } from '../lib/store'
import { mapOf } from '../server/lib'
import { ObjectId } from 'mongodb'
/**
*
* {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())
}
const store = () => Data.getStore('Image')
export default class Image {