core tests
Some checks failed
Some checks failed
This commit is contained in:
@@ -4,8 +4,8 @@ export class Position {
|
||||
private constructor(private readonly value: number) {}
|
||||
|
||||
static create(value: number): Position {
|
||||
if (!Number.isInteger(value) || value < 0) {
|
||||
throw new RacingDomainValidationError('Position must be a non-negative integer');
|
||||
if (!Number.isInteger(value) || value <= 0) {
|
||||
throw new RacingDomainValidationError('Position must be a positive integer');
|
||||
}
|
||||
return new Position(value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user