lint-fix
This commit is contained in:
parent
8eea585e11
commit
74b1892cd1
|
|
@ -1517,11 +1517,11 @@ export const executeJavaScriptCode = async (
|
|||
// Install libraries
|
||||
for (const library of librariesToInstall) {
|
||||
// Validate library name to prevent command injection.
|
||||
const validPackageNameRegex = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/;
|
||||
const validPackageNameRegex = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?[a-z0-9-~][a-z0-9-._~]*$/
|
||||
if (validPackageNameRegex.test(library)) {
|
||||
await sbx.commands.run(`npm install ${library}`)
|
||||
} else {
|
||||
console.warn(`[Sandbox] Skipping installation of invalid module: ${library}`);
|
||||
console.warn(`[Sandbox] Skipping installation of invalid module: ${library}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue