Skip to content

Commit 0761b70

Browse files
committed
Fix ESLint warnings in source code - Remove unused variables and functions
1 parent 89f9c95 commit 0761b70

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/index.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ function validateModuleName(name) {
2525
return name;
2626
}
2727

28-
function securePathJoin(...paths) {
29-
// Prevent path traversal by normalizing and validating the resulting path
30-
const result = path.normalize(path.join(...paths));
31-
const basePath = path.normalize(paths[0]);
32-
33-
if (!result.startsWith(basePath)) {
34-
throw new Error(`Path traversal detected: ${result} is outside of ${basePath}`);
35-
}
36-
return result;
37-
}
38-
3928
function calculateFileHash(filePath) {
4029
return new Promise((resolve, reject) => {
4130
const hash = crypto.createHash('sha256');
@@ -68,10 +57,9 @@ async function run() {
6857
throw new Error(`Module path does not exist: ${modulePath}`);
6958
}
7059

71-
// Parse Google credentials
72-
let credentials;
60+
// Parse Google credentials to validate JSON format
7361
try {
74-
credentials = JSON.parse(googleCredentialsJson);
62+
JSON.parse(googleCredentialsJson);
7563
} catch (error) {
7664
throw new Error(`Failed to parse Google credentials: ${error.message}`);
7765
}

0 commit comments

Comments
 (0)