nestjs-reverse-engineering
Version:
A powerful TypeScript/NestJS library for database reverse engineering, entity generation, and CRUD operations
71 lines • 2.07 kB
TypeScript
export declare class NamingUtils {
/**
* Convert snake_case to PascalCase
*/
static toPascalCase(str: string): string;
/**
* Convert snake_case to camelCase
*/
static toCamelCase(str: string): string;
/**
* Convert PascalCase or camelCase to snake_case
*/
static toSnakeCase(str: string): string;
/**
* Convert PascalCase, camelCase, or snake_case to kebab-case
*/
static toKebabCase(str: string): string;
/**
* Convert kebab-case to PascalCase
*/
static kebabToPascalCase(str: string): string;
/**
* Convert kebab-case to camelCase
*/
static kebabToCamelCase(str: string): string;
/**
* Sanitize table/column names for TypeScript
*/
static sanitizeName(name: string): string;
/**
* Check if a name is a reserved keyword
*/
static isReservedKeyword(name: string): boolean;
/**
* Generate a safe property name
*/
static toSafePropertyName(columnName: string, convention?: 'camelCase' | 'PascalCase' | 'snake_case'): string;
/**
* Generate a safe class name from table name
*/
static toSafeClassName(tableName: string): string;
/**
* Generate a safe enum name
*/
static toSafeEnumName(value: string): string;
/**
* Extract enum values from PostgreSQL enum definition
*/
static parseEnumValues(enumDefinition: string): string[];
/**
* Generate file name from table name
*/
static toFileName(tableName: string): string;
/**
* Handle composite names (tables with spaces, special chars)
*/
static handleCompositeName(name: string): {
original: string;
safe: string;
quoted: boolean;
};
/**
* Generate relationship property name
*/
static toRelationshipName(tableName: string, isCollection?: boolean): string;
/**
* Simple pluralization (can be enhanced with a library like 'pluralize')
*/
private static pluralize;
}
//# sourceMappingURL=naming-utils.d.ts.map