Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import EJSON from 'ejson';
import Collection from '../Collection';
import Data from '../Data';
import setProperties from './setProperties';
if (!EJSON._getTypes()['FS.File']) {
EJSON.addType('FS.File', function(value) {
return {
getFileRecord() {
const collection =
Data.db['cfs.' + value.collectionName + '.filerecord'];
const item = collection && collection.get(value._id);
if (!item) return value;
return setProperties(value.collectionName, item);
},
};
});
}