refactor
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
import type { IValueObject } from '@core/shared/domain';
|
||||
|
||||
export interface PointsTableProps {
|
||||
pointsByPosition: Map<number, number>;
|
||||
pointsByPosition: ReadonlyMap<number, number>;
|
||||
}
|
||||
|
||||
export class PointsTable implements IValueObject<PointsTableProps> {
|
||||
private readonly pointsByPosition: Map<number, number>;
|
||||
private readonly pointsByPosition: ReadonlyMap<number, number>;
|
||||
|
||||
constructor(pointsByPosition: Record<number, number> | Map<number, number>) {
|
||||
if (pointsByPosition instanceof Map) {
|
||||
@@ -27,7 +27,7 @@ export class PointsTable implements IValueObject<PointsTableProps> {
|
||||
|
||||
get props(): PointsTableProps {
|
||||
return {
|
||||
pointsByPosition: new Map(this.pointsByPosition),
|
||||
pointsByPosition: this.pointsByPosition,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user