refactor: replace number health with Health value object in MagicalObject
- MagicalObject: internal #health and #maxHealth now Health type - HealingObject: constructor, create, and heal use Health value object - MagicalWeapon: constructor, create, and use use Health value object - DamageDealer and Healer interfaces: health: number -> health: Health - magical-objects.spec.ts: all assertions use .health.value - Run npm run checks: 0 errors, 70 tests passing
This commit is contained in:
@@ -4,9 +4,7 @@ import { join, parse } from 'node:path';
|
||||
const VALUE_OBJECTS_DIR = join(import.meta.dirname, '..', 'src', 'value-objects');
|
||||
|
||||
function discoverValueObjects() {
|
||||
const files = readdirSync(VALUE_OBJECTS_DIR).filter(
|
||||
(f) => f.endsWith('.ts') && f !== 'index.ts',
|
||||
);
|
||||
const files = readdirSync(VALUE_OBJECTS_DIR).filter((f) => f.endsWith('.ts') && f !== 'index.ts');
|
||||
return files.map((f) => parse(f).name);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user