export async function migrate(): Promise { for (const a of game.actors.entities) { const updateData = getActorUpdateData(); console.log(`Migrating actor ${a.name}`); await a.update(updateData, { enforceTypes: false }); } } function getActorUpdateData(): Record { const updateData = { data: { combatValues: [ "hitPoints", "defense", "initiative", "movement", "meleeAttack", "rangedAttack", "spellcasting", "targetedSpellcasting", ].reduce((acc, curr) => { acc[curr] = { "-=base": null }; return acc; }, {}), }, }; return updateData; }