CartoDB-SQL-API/lib/utils/filename-sanitizer.js
Daniel García Aubert 014158c968 Eslint errors
2019-12-26 17:46:27 +01:00

10 lines
287 B
JavaScript

'use strict';
var path = require('path');
module.exports = function sanitizeFilename (filename) {
filename = path.basename(filename, path.extname(filename));
filename = filename.replace(/[;()\[\]<>'"\s]/g, '_'); // eslint-disable-line no-useless-escape
return filename;
};