2020-04-05 19:52:48 +03:00
|
|
|
const adapterManager = require('../../services/adapter-manager');
|
2013-11-07 20:00:39 +04:00
|
|
|
|
2021-10-20 18:13:15 +03:00
|
|
|
/**
|
2021-10-25 13:51:04 +03:00
|
|
|
* @param {'images'|'media'|'files'} [feature] - name for the "feature" to enable through adapter, e.g.: images or media storage
|
2021-10-20 18:13:15 +03:00
|
|
|
* @returns {Object} adapter instance
|
|
|
|
*/
|
|
|
|
function getStorage(feature) {
|
|
|
|
let adapterName = 'storage';
|
|
|
|
|
|
|
|
if (feature) {
|
|
|
|
adapterName += `:${feature}`;
|
|
|
|
}
|
|
|
|
|
|
|
|
return adapterManager.getAdapter(adapterName);
|
2013-11-07 20:00:39 +04:00
|
|
|
}
|
|
|
|
|
2014-09-10 08:06:24 +04:00
|
|
|
module.exports.getStorage = getStorage;
|