Add snake case properties
This commit is contained in:
parent
82c2122bcf
commit
e4761d8f50
@ -11,7 +11,7 @@ export default interface IGenerationOptions {
|
||||
noConfigs: boolean;
|
||||
convertCaseFile: "pascal" | "param" | "camel" | "none";
|
||||
convertCaseEntity: "pascal" | "camel" | "none";
|
||||
convertCaseProperty: "pascal" | "camel" | "none";
|
||||
convertCaseProperty: "pascal" | "camel" | "snake" | "none";
|
||||
convertEol: "LF" | "CRLF";
|
||||
propertyVisibility: "public" | "protected" | "private" | "none";
|
||||
lazy: boolean;
|
||||
|
@ -212,6 +212,9 @@ function createHandlebarsHelpers(generationOptions: IGenerationOptions): void {
|
||||
case "none":
|
||||
retStr = str;
|
||||
break;
|
||||
case "snake":
|
||||
retStr = changeCase.snakeCase(str);
|
||||
break;
|
||||
default:
|
||||
throw new Error("Unknown case style");
|
||||
}
|
||||
|
@ -11,6 +11,7 @@ import IGenerationOptions, {
|
||||
import fs = require("fs-extra");
|
||||
import inquirer = require("inquirer");
|
||||
import path = require("path");
|
||||
import { string } from "yargs";
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
CliLogic();
|
||||
@ -211,7 +212,7 @@ function checkYargsParameters(options: options): options {
|
||||
},
|
||||
cp: {
|
||||
alias: "case-property",
|
||||
choices: ["pascal", "camel", "none"],
|
||||
choices: ["pascal", "camel", "snake", "none"],
|
||||
default: options.generationOptions.convertCaseProperty,
|
||||
describe: "Convert property names to specified case",
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user