Skip to content

Commit

Permalink
Sanitize file name
Browse files Browse the repository at this point in the history
  • Loading branch information
mfix22 committed Apr 25, 2017
1 parent 7be4051 commit e6ef116
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"react-dnd-html5-backend": "^2.1.2",
"react-dom": "^15.4.2",
"react-sortable-hoc": "^0.6.2",
"sanitize-filename": "^1.6.1",
"string": "^3.3.3"
},
"name": "alchemy",
Expand Down
6 changes: 4 additions & 2 deletions src/helpers/util.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const sanitizeFileName = require('sanitize-filename')
const { pluck, compose, map } = require('./functional')
const { fileTypes } = require('./constants')

const replaceSpaceCharacters = str =>
str.replace(/\s/g, '\\ ')
.replace(/'/g, '\\\'')
sanitizeFileName(str)
.replace(/\s/g, '\\ ')
.replace(/'/g, '\\\'')

const concatFiles = files =>
files.map(path => path.split('/').pop())
Expand Down

0 comments on commit e6ef116

Please sign in to comment.