Added confirmation on import of old character data

This commit is contained in:
WBHarry 2025-08-22 01:31:16 +02:00
parent bcb678d059
commit f8d1c9d5ba
4 changed files with 46 additions and 24 deletions

View file

@ -420,3 +420,14 @@ export async function createEmbeddedItemsWithEffects(actor, baseData) {
export const slugify = name => {
return name.toLowerCase().replaceAll(' ', '-').replaceAll('.', '');
};
export const versionCompare = (current, target) => {
const currentSplit = current.split('.').map(x => Number.parseInt(x));
const targetSplit = target.split('.').map(x => Number.parseInt(x));
for (var i = 0; i < currentSplit.length; i++) {
if (currentSplit[i] < targetSplit[i]) return true;
if (currentSplit[i] > targetSplit[i]) return false;
}
return false;
};