File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' ) ;
2
2
const path = require ( 'path' ) ;
3
3
const eol = require ( 'os' ) . EOL ;
4
+ const sanitize = require ( "sanitize-filename" ) ;
4
5
5
6
module . exports = {
6
7
defaultConfig : {
@@ -24,7 +25,7 @@ module.exports = {
24
25
writeProfileToFile ( proxy , req , resp ) {
25
26
const wizard_id = resp . friend . wizard_id ;
26
27
const wizard_name = resp . friend . wizard_name ;
27
- const filename = `${ wizard_name } -${ wizard_id } -visit.json` ;
28
+ const filename = sanitize ( `${ wizard_name } |. -${ wizard_id } ` ) . concat ( ' -visit.json' ) ;
28
29
29
30
var outFile = fs . createWriteStream (
30
31
path . join ( config . Config . App . filesPath , filename ) , {
Original file line number Diff line number Diff line change 1
1
const fs = require ( 'fs' ) ;
2
2
const path = require ( 'path' ) ;
3
3
const eol = require ( 'os' ) . EOL ;
4
+ const sanitize = require ( "sanitize-filename" ) ;
4
5
5
6
module . exports = {
6
7
defaultConfig : {
@@ -24,7 +25,7 @@ module.exports = {
24
25
writeProfileToFile ( proxy , req , resp ) {
25
26
const wizard_id = resp . wizard_info . wizard_id ;
26
27
const wizard_name = resp . wizard_info . wizard_name ;
27
- const filename = `${ wizard_name } -${ wizard_id } . json` ;
28
+ const filename = sanitize ( `${ wizard_name } -${ wizard_id } ` ) . concat ( '. json' ) ;
28
29
29
30
var outFile = fs . createWriteStream (
30
31
path . join ( config . Config . App . filesPath , filename ) , {
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " sw-exporter" ,
3
3
"productName" : " Summoners War Exporter" ,
4
- "version" : " 0.0.10 " ,
4
+ "version" : " 0.0.11 " ,
5
5
"description" : " This tool will parse intercepted data from Summoners War and extract information on the monsters and runes of the user." ,
6
6
"main" : " ./app/main.js" ,
7
7
"scripts" : {
17
17
"appId" : " com.electron.sw-exporter" ,
18
18
"win" : {
19
19
"target" : [
20
- " zip" , " portable"
20
+ " zip" ,
21
+ " portable"
21
22
]
22
23
}
23
24
},
50
51
"react-dom" : " ^15.4.2" ,
51
52
"react-router" : " ^3.0.2" ,
52
53
"request" : " ^2.81.0" ,
54
+ "sanitize-filename" : " ^1.6.1" ,
53
55
"semantic-ui-react" : " ^0.67.1"
54
56
}
55
57
}
You can’t perform that action at this time.
0 commit comments