safelaunch 1.0.21 → 1.0.22
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/package.json +1 -1
- package/safelaunch/src/scan.js +6 -4
package/package.json
CHANGED
package/safelaunch/src/scan.js
CHANGED
|
@@ -99,11 +99,12 @@ function detectProjectType(cwd) {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function scanFiles(dir, extensions, pattern, found = new Set()) {
|
|
102
|
-
|
|
102
|
+
let items;
|
|
103
|
+
try { items = fs.readdirSync(dir); } catch (_) { return found; }
|
|
103
104
|
for (const item of items) {
|
|
104
105
|
if (item === 'node_modules' || item === '.git') continue;
|
|
105
106
|
const full = path.join(dir, item);
|
|
106
|
-
|
|
107
|
+
let stat; try { stat = fs.statSync(full); } catch (_) { continue; }
|
|
107
108
|
if (stat.isDirectory()) {
|
|
108
109
|
scanFiles(full, extensions, pattern, found);
|
|
109
110
|
} else if (extensions.some(ext => item.endsWith(ext))) {
|
|
@@ -195,11 +196,12 @@ function checkHardcodedSecrets(cwd) {
|
|
|
195
196
|
const hits = [];
|
|
196
197
|
function walk(dir) {
|
|
197
198
|
try {
|
|
198
|
-
|
|
199
|
+
let items;
|
|
200
|
+
try { items = fs.readdirSync(dir); } catch (_) { return found; }
|
|
199
201
|
for (const item of items) {
|
|
200
202
|
if (item === 'node_modules' || item === '.git') continue;
|
|
201
203
|
const full = path.join(dir, item);
|
|
202
|
-
|
|
204
|
+
let stat; try { stat = fs.statSync(full); } catch (_) { continue; }
|
|
203
205
|
if (stat.isDirectory()) {
|
|
204
206
|
walk(full);
|
|
205
207
|
} else if (extensions.some(ext => item.endsWith(ext))) {
|