Skip to content

Commit

Permalink
Merge pull request #11827 from qmonmert/arrowfct
Browse files Browse the repository at this point in the history
Convert some functions to arrow functions
  • Loading branch information
murdos authored Jan 30, 2025
2 parents d29c851 + d8f2f68 commit 9faca9d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
4 changes: 1 addition & 3 deletions src/main/webapp/app/module/primary/PropertyValue.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { ModuleParameterType } from '../domain/ModuleParameters';
import { ModulePropertyDefinitionType } from '../domain/ModulePropertyDefinitionType';

export const notEmpty = (value: ModuleParameterType | undefined): boolean => {
return !empty(value);
};
export const notEmpty = (value: ModuleParameterType | undefined): boolean => !empty(value);

export const empty = (value: ModuleParameterType | undefined): boolean => {
if (value === undefined) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,4 @@ export default defineComponent({
},
});

const empty = (value: string): boolean => {
return value.trim().length === 0;
};
const empty = (value: string): boolean => value.trim().length === 0;
9 changes: 3 additions & 6 deletions src/test/webapp/unit/module/domain/Modules.fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,8 @@ export const defaultModulesToApply = (): ModulesToApply => ({
parameters: defaultPropertiesToApply(),
});

const defaultPropertiesToApply = () => {
return new Map<string, ModuleParameterType>().set('baseName', 'testproject').set('optionalBoolean', true).set('optionalInteger', 42);
};
const defaultPropertiesToApply = () =>
new Map<string, ModuleParameterType>().set('baseName', 'testproject').set('optionalBoolean', true).set('optionalInteger', 42);

export const defaultProjectHistory = (): ProjectHistory => ({
modules: [moduleSlug('spring-cucumber')],
Expand All @@ -174,9 +173,7 @@ export const projectHistoryWithInit = (): ProjectHistory => ({
properties: appliedModuleProperties(),
});

const appliedModuleProperties = (): ModulePropertyValue[] => {
return [{ key: 'baseName', value: 'setbase' }];
};
export const appliedModuleProperties = (): ModulePropertyValue[] => [{ key: 'baseName', value: 'setbase' }];

export const defaultProject = (): Project => ({
filename: 'jhipster.zip',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ export const defaultLandscape = (): Landscape =>
},
]);

export const javaBuildToolFeature = (): LandscapeFeature => {
return new LandscapeFeature(featureSlug('java-build-tools'), [
export const javaBuildToolFeature = (): LandscapeFeature =>
new LandscapeFeature(featureSlug('java-build-tools'), [
initialModule('maven', 'Add maven', [optionalBooleanPropertyDefinition()], moduleSlugs('init')),
initialModule('gradle', 'Add gradle', [], moduleSlugs('init')),
]);
};

const initialModule = (
slug: string,
Expand Down

0 comments on commit 9faca9d

Please sign in to comment.