@reldens/server-utils 0.8.0 → 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -37,10 +37,7 @@ class FileHandler
37
37
  return false;
38
38
  }
39
39
  let pathStr = String(filePath);
40
- if(pathStr.includes('../') || pathStr.includes('..\\')){
41
- return false;
42
- }
43
- return true;
40
+ return !(pathStr.includes('../') || pathStr.includes('..\\'));
44
41
  }
45
42
 
46
43
  sanitizePath(filePath)
@@ -48,11 +45,10 @@ class FileHandler
48
45
  if(!filePath){
49
46
  return '';
50
47
  }
51
- let sanitized = String(filePath)
48
+ return String(filePath)
52
49
  .replace(/\.\./g, '')
53
50
  .replace(/[:*?"<>|]/g, '')
54
51
  .substring(0, 255);
55
- return sanitized;
56
52
  }
57
53
 
58
54
  generateSecureFilename(originalName)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@reldens/server-utils",
3
3
  "scope": "@reldens",
4
- "version": "0.8.0",
4
+ "version": "0.9.0",
5
5
  "description": "Reldens - Server Utils",
6
6
  "author": "Damian A. Pastorini",
7
7
  "license": "MIT",