Adding the project for code injection and XSS vulnerability testing
This project is designed to help developers understand and mitigate code injection and XSS vulnerabilities. It includes a backend API and a frontend interface for testing various attack vectors in a controlled environment.
This commit is contained in:
23
frontend/scripts/check-format.ts
Normal file
23
frontend/scripts/check-format.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { exec } from 'child_process';
|
||||
import { promisify } from 'util';
|
||||
import ora from 'ora';
|
||||
|
||||
const execPromise = promisify(exec);
|
||||
|
||||
async function run() {
|
||||
const spinner = ora('Checking code formatting...').start();
|
||||
|
||||
try {
|
||||
const { stdout } = await execPromise(
|
||||
'npm run pretty-quick --check . --config .prettierrc'
|
||||
);
|
||||
spinner.succeed('Code formatting check passed.');
|
||||
console.log(stdout);
|
||||
} catch (error: any) {
|
||||
spinner.fail('Code formatting check failed.');
|
||||
console.error(error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
run();
|
||||
Reference in New Issue
Block a user