CartoDB-SQL-API/lib/utils/filename-sanitizer.js
Daniel García Aubert 5a96dbb59c Run eslint --fix
2019-12-23 18:19:08 +01:00

10 lines
247 B
JavaScript

'use strict';
var path = require('path');
module.exports = function sanitize_filename (filename) {
filename = path.basename(filename, path.extname(filename));
filename = filename.replace(/[;()\[\]<>'"\s]/g, '_');
return filename;
};