Skip to content

Commit

Permalink
Clean code: remove unused constant (#28385)
Browse files Browse the repository at this point in the history
  • Loading branch information
qmonmert authored Jan 5, 2025
1 parent 8566b30 commit ceee0da
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 82 deletions.
2 changes: 0 additions & 2 deletions generators/angular/support/reserved-keywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,3 @@ export const angularReservedKeywords = [
'HTTP',
'ROUTER',
];

export const isReservedAngularKeyword = (keyword: string) => angularReservedKeywords.includes(keyword.toUpperCase());
2 changes: 0 additions & 2 deletions generators/client/support/typescript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,3 @@ export const typescriptReservedKeywords = [
'STATIC',
'YIELD',
];

export const isReservedTypescriptKeyword = (keyword: string) => typescriptReservedKeywords.includes(keyword.toUpperCase());
14 changes: 0 additions & 14 deletions generators/gradle/internal/needles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,6 @@ export const addGradleDependenciesCallback = (dependencies: GradleDependency[])
contentToAdd: dependencies.map(serializeDependency),
});

/** @deprecated use addGradleDependenciesCallback */
export const addGradleBuildSrcDependencyCallback = (dependency: GradleDependency) =>
createNeedleCallback({
needle: 'gradle-build-src-dependency',
contentToAdd: serializeDependency(dependency),
});

export const addGradleDependenciesCatalogVersionCallback = (versions: GradleTomlVersion[]) =>
createNeedleCallback({
needle: 'gradle-dependency-catalog-version',
Expand Down Expand Up @@ -153,13 +146,6 @@ export const addGradlePluginFromCatalogCallback = (plugins: GradleTomlPlugin[])
.map(({ pluginName }) => `alias(libs.plugins.${gradleNameToReference(pluginName)})`),
});

/** @deprecated use addGradleDependenciesCatalogVersionCallback */
export const addGradleBuildSrcDependencyCatalogVersionCallback = ({ name, version }: GradleTomlVersion) =>
createNeedleCallback({
needle: 'gradle-build-src-dependency-catalog-version',
contentToAdd: `${name} = "${version}"`,
});

export const addGradlePluginCallback = ({ id, version }: GradlePlugin) =>
createNeedleCallback({
needle: 'gradle-plugins',
Expand Down
9 changes: 0 additions & 9 deletions generators/java/support/files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,9 @@ export const moveToJavaPackageSrcDir = (data: any, filePath: string) =>
export const moveToJavaPackageTestDir = (data: any, filePath: string) =>
`${data.javaPackageTestDir}${replaceEntityFilePathVariables(data, filePath) ?? ''}`;

export const moveToJavaEntityPackageSrcDir = (data: any, filePath: string) =>
`${data.srcMainJava}${data.entityAbsoluteFolder}${replaceEntityFilePathVariables(data, filePath) ?? ''}`;

export const moveToJavaEntityPackageTestDir = (data: any, filePath: string) =>
`${data.srcTestJava}${data.entityAbsoluteFolder}${replaceEntityFilePathVariables(data, filePath) ?? ''}`;

export const moveToSrcMainResourcesDir = (data: any, filePath: string) =>
`${data.srcMainResources}${replaceEntityFilePathVariables(data, filePath) ?? ''}`;

export const moveToSrcTestResourcesDir = (data: any, filePath: string) =>
`${data.srcTestResources}${replaceEntityFilePathVariables(data, filePath) ?? ''}`;

type RelativeWriteFileBlock = WriteFileBlock & { relativePath?: string };

export function javaMainPackageTemplatesBlock<Data = ApplicationType<Entity>>(
Expand Down
43 changes: 0 additions & 43 deletions generators/java/support/java-formatting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,46 +35,3 @@ export const javaBeanCase = (beanName: string): string => {
}
return upperFirst(beanName);
};

/**
* @private
* Create a java getter of reference.
*
* @param {object|string[]} reference
* @return {string}
*/
export const buildJavaGet = reference => {
let refPath;
if (typeof refPath === 'string') {
refPath = [reference];
} else if (Array.isArray(reference)) {
refPath = reference;
} else {
refPath = [reference.name];
}
return refPath.map(partialPath => `get${javaBeanCase(partialPath)}()`).join('.');
};

/**
* @private
* Create a java getter method of reference.
*
* @param {object} reference
* @param {string} type
* @return {string}
*/
export const buildJavaGetter = (reference, type = reference.type) => {
return `${type} get${javaBeanCase(reference.name)}()`;
};

/**
* @private
* Create a java getter method of reference.
*
* @param {object} reference
* @param {string} valueDefinition
* @return {string}
*/
export const buildJavaSetter = (reference, valueDefinition = `${reference.type} ${reference.name}`) => {
return `set${javaBeanCase(reference.name)}(${valueDefinition})`;
};
2 changes: 0 additions & 2 deletions generators/spring-data-cassandra/support/reserved-keywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,3 @@ export const cassandraReservedKeywords = [
'MACADDR',
'BITSTRING',
];

export const isReservedCassandraKeyword = (keyword: string) => cassandraReservedKeywords.includes(keyword.toUpperCase());
2 changes: 0 additions & 2 deletions generators/spring-data-couchbase/support/reserved-keywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,3 @@ export const couchbaseReservedKeywords = [
'WITH',
'WRITE',
];

export const isReservedCouchbaseKeyword = (keyword: string) => couchbaseReservedKeywords.includes(keyword.toUpperCase());
2 changes: 0 additions & 2 deletions generators/spring-data-neo4j/support/reserved-keywords.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,3 @@ export const neo4jReservedKeywords = [
'REQUIRE',
'SCALAR',
];

export const isReservedNeo4jKeyword = (keyword: string) => neo4jReservedKeywords.includes(keyword.toUpperCase());
Original file line number Diff line number Diff line change
Expand Up @@ -204,5 +204,3 @@ export const mssqlReservedKeywords = [
'WITHIN GROUP',
'WRITETEXT',
];

export const isReservedMssqlKeyword = (keyword: string) => mssqlReservedKeywords.includes(keyword.toUpperCase());
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,3 @@ export const mysqlReservedKeywords = [
'SLOW',
'WINDOW',
];

export const isReservedMysqlKeyword = (keyword: string) => mysqlReservedKeywords.includes(keyword.toUpperCase());
Original file line number Diff line number Diff line change
Expand Up @@ -500,5 +500,3 @@ export const oracleReservedKeywords = [
'YEAR',
'ZONE',
];

export const isReservedOracleKeyword = (keyword: string) => oracleReservedKeywords.includes(keyword.toUpperCase());

0 comments on commit ceee0da

Please sign in to comment.