5etools-utils 0.13.7 → 0.13.8
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.
- package/lib/BrewCleaner.js +5 -2
- package/package.json +1 -1
package/lib/BrewCleaner.js
CHANGED
|
@@ -126,7 +126,10 @@ class _BrewFileTester {
|
|
|
126
126
|
export class BrewCleaner {
|
|
127
127
|
static _IS_FAIL_SLOW = !!process.env.FAIL_SLOW;
|
|
128
128
|
|
|
129
|
-
|
|
129
|
+
// Exclude:
|
|
130
|
+
// - Characters which are invalid in Windows filenames
|
|
131
|
+
// - Characters which have significance in a URL
|
|
132
|
+
static _RE_INVALID_CHARS = /[<>:"/\\|?*#%@]/;
|
|
130
133
|
|
|
131
134
|
static _cleanFolder (folder) {
|
|
132
135
|
const ALL_ERRORS = [];
|
|
@@ -135,7 +138,7 @@ export class BrewCleaner {
|
|
|
135
138
|
for (const file of files) {
|
|
136
139
|
let contents = Uf.readJsonSync(file);
|
|
137
140
|
|
|
138
|
-
if (this.
|
|
141
|
+
if (this._RE_INVALID_CHARS.test(file.split("/").slice(1).join("/"))) {
|
|
139
142
|
ALL_ERRORS.push(`${file} contained invalid characters!`);
|
|
140
143
|
if (!this._IS_FAIL_SLOW) break;
|
|
141
144
|
}
|