Fixde boilerplate to use snake case

This commit is contained in:
Bertie690 2025-04-25 23:47:14 -04:00
parent c043ebf7c4
commit a3122a6786

View File

@ -72,16 +72,15 @@ async function runInteractive() {
const type = typeAnswer.selectedOption.toLowerCase();
// Convert fileName from kebab-case or camelCase to snake_case
// Ex: "Cud Chew/Cud-Chew" --> "cud_chew"
// Ex: "Cud Chew/Cud-Chew" --> "cud-chew"
const fileName = fileNameAnswer.userInput
.replace(/-+/g, "_") // Convert kebab-case (dashes) to underscores
.replace(/([a-z])([A-Z])/g, "$1_$2") // Convert camelCase to snake_case
.replace(/\s+/g, "_") // Replace spaces with underscores
.replace(/\s+/g, "-") // Replace spaces with underscores
.toLowerCase(); // Ensure all lowercase
// Get proper english name for test names and data name for abilities/moves
const formattedName = fileName.replace(/_/g, " ").replace(/\b\w/g, char => char.toUpperCase());
const attrName = fileName.toUpperCase(); // Used for move/ability tests to override with ability/move being tested
const formattedName = fileName.replace(/-/g, " ").replace(/\b\w/g, char => char.toUpperCase());
const attrName = fileName.replace(/-+/g, "_").toUpperCase(); // enum names are snake case, fullcaps
// Determine the directory based on the type
let dir;
let description;