RC-42 | Weapon | Damage

This commit is contained in:
Oliver-Akins 2024-12-25 22:16:08 -07:00
parent 0e9218fbd3
commit b578ecb10d
2 changed files with 16 additions and 1 deletions

View file

@ -29,3 +29,17 @@ export function optionalInteger({min, initial = null, max} = {}) {
integer: true,
});
};
export function requiredInteger({ min, initial, max } = {}) {
if (initial == null || typeof initial !== `number`) {
throw new Error(`"initial" must be a number`);
};
return new fields.NumberField({
min,
initial,
max,
required: true,
nullable: false,
integer: true,
});
};