mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-06 08:22:16 +02:00
Fixde boilerplate to use snake case
This commit is contained in:
parent
c043ebf7c4
commit
a3122a6786
@ -72,16 +72,15 @@ async function runInteractive() {
|
|||||||
|
|
||||||
const type = typeAnswer.selectedOption.toLowerCase();
|
const type = typeAnswer.selectedOption.toLowerCase();
|
||||||
// Convert fileName from kebab-case or camelCase to snake_case
|
// 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
|
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(/([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
|
.toLowerCase(); // Ensure all lowercase
|
||||||
|
|
||||||
// Get proper english name for test names and data name for abilities/moves
|
// 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 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 attrName = fileName.replace(/-+/g, "_").toUpperCase(); // enum names are snake case, fullcaps
|
||||||
// Determine the directory based on the type
|
// Determine the directory based on the type
|
||||||
let dir;
|
let dir;
|
||||||
let description;
|
let description;
|
||||||
|
Loading…
Reference in New Issue
Block a user