9 lines
331 B
TypeScript
9 lines
331 B
TypeScript
import { PointsTable } from '@core/racing/domain/value-objects/PointsTable';
|
|
|
|
export const makePointsTable = (points: number[]): PointsTable => {
|
|
const pointsByPosition: Record<number, number> = {};
|
|
points.forEach((value, index) => {
|
|
pointsByPosition[index + 1] = value;
|
|
});
|
|
return new PointsTable(pointsByPosition);
|
|
}; |