handlers/_swagger.js
function handleMulterConfig(multerConfig, logger, serviceLoader) {
    // Special handling of storage
    var storageString = _.get(multerConfig, 'storage');
    if (storageString) {
        var multerStorage;
        if (storageString === MULTER_MEMORY_STORAGE) {
            // simple memory storage
            logger.debug('loading simple multer memoryStorage');
            multerStorage = multer.memoryStorage();
        } else {
            // otherwise try and load the service for custom multer storage engine
            logger.debug('loading custom multer storage service');
            var multerService = serviceLoader.get(storageString);
            if (!multerService) {
                logger.warn('Multer config "storage" property must either be "' + MULTER_MEMORY_STORAGE + '"');
                logger.warn('or the name of a service that returns a multer storage engine');
            } else {
                multerStorage = multerService.storage;
            }
        }
        _.set(multerConfig, 'storage', multerStorage);
    }

    return multerConfig;
}
function handleMulterConfig(multerConfig, logger, serviceLoader) {
    // Special handling of storage
    var storageString = _.get(multerConfig, 'storage');
    if (storageString) {
        var multerStorage;
        if (storageString === MULTER_MEMORY_STORAGE) {
            // simple memory storage
            logger.debug('loading simple multer memoryStorage');
            multerStorage = multer.memoryStorage();
        } else {
            // otherwise try and load the service for custom multer storage engine
            logger.debug('loading custom multer storage service');
            var multerService = serviceLoader.get(storageString);
            if (!multerService) {
                logger.warn('Multer config "storage" property must either be "' + MULTER_MEMORY_STORAGE + '"');
                logger.warn('or the name of a service that returns a multer storage engine');
            } else {
                multerStorage = multerService.storage;
            }
        }
        _.set(multerConfig, 'storage', multerStorage);
    }

    return multerConfig;
}
function handleMulterConfig ( multerConfig , logger , serviceLoader ) { // Special handling of storage var storageString = _ . get ( multerConfig , 'storage' ) ; if ( storageString ) { var multerStorage ; if ( storageString === MULTER_MEMORY_STORAGE ) { // simple memory storage logger . debug ( 'loading simple multer memoryStorage' ) ; multerStorage = multer . memoryStorage ( ) ; } else { // otherwise try and load the service for custom multer storage engine logger . debug ( 'loading custom multer storage service' ) ; var multerService = serviceLoader . get ( storageString ) ; if ( ! multerService ) { logger . warn ( 'Multer config "storage" property must either be "' + MULTER_MEMORY_STORAGE + '"' ) ; logger . warn ( 'or the name of a service that returns a multer storage engine' ) ; } else { multerStorage = multerService . storage ; } } _ . set ( multerConfig , 'storage' , multerStorage ) ; } return multerConfig ; }
Checks the multer config if the storage property is set to either the memoryStorage enum or the name of a custom multerService implementing a multer storage engine.
Checks the multer config if the storage property is set to either the memoryStorage enum or the name of a custom multerService implementing a multer storage engine .