Skip to content

Commit

Permalink
Remove static constructor from Control Option class
Browse files Browse the repository at this point in the history
  • Loading branch information
widoz committed Feb 14, 2024
1 parent ea6874a commit 7aff7bd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ export function convertEntitiesToControlOptions<
const label = entity[labelKey];
const value = entity[valueKey];
assert(typeof label === 'string', 'Label Key must be a string');
return ControlOption.new(label, value);
return new ControlOption(label, value);
});
}
6 changes: 1 addition & 5 deletions sources/client/src/vo/control-option.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@ export class ControlOption<V> implements EntitiesSearch.ControlOption<V> {
public readonly label: string;
public readonly value: V;

static new<V>(label: string, value: V): ControlOption<V> {
return new ControlOption(label, value);
}

private constructor(label: string, value: V) {
public constructor(label: string, value: V) {
assert(
label !== '',
'ControlOption: Label must be a non empty string.'
Expand Down

0 comments on commit 7aff7bd

Please sign in to comment.