chore: reformat with 2 spaces
This commit is contained in:
parent
d659e4bed9
commit
7670d7f808
1577 changed files with 70010 additions and 70042 deletions
|
@ -3,31 +3,31 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
|
||||
import {
|
||||
getSceneMigrator,
|
||||
migrateCollection,
|
||||
migrateCompendiums,
|
||||
getCompendiumMigrator,
|
||||
getActorMigrator,
|
||||
getSceneMigrator,
|
||||
migrateCollection,
|
||||
migrateCompendiums,
|
||||
getCompendiumMigrator,
|
||||
getActorMigrator,
|
||||
} from "./migrationHelpers.js";
|
||||
|
||||
/** @type {import("./migration.js").Migration["migrate"]} */
|
||||
async function migrate() {
|
||||
const actorsResult = await migrateCollection(game.actors, migrateActor);
|
||||
const scenesResult = await migrateCollection(game.scenes, migrateScene);
|
||||
const compendiumsResult = await migrateCompendiums(migrateCompendium);
|
||||
return actorsResult === "error" || scenesResult === "error" || compendiumsResult === "error" ? "error" : "success";
|
||||
const actorsResult = await migrateCollection(game.actors, migrateActor);
|
||||
const scenesResult = await migrateCollection(game.scenes, migrateScene);
|
||||
const compendiumsResult = await migrateCompendiums(migrateCompendium);
|
||||
return actorsResult === "error" || scenesResult === "error" || compendiumsResult === "error" ? "error" : "success";
|
||||
}
|
||||
|
||||
const itemIdRegex = /Item\.([a-zA-Z0-9]+)/;
|
||||
|
||||
/** @type {import('./migrationHelpers.js').Migrator<ActiveEffect>} */
|
||||
async function migrateActiveEffect(activeEffect) {
|
||||
if (activeEffect.parent instanceof Actor) {
|
||||
const itemId = activeEffect.origin?.match(itemIdRegex)?.[1];
|
||||
if (activeEffect.parent.items.has(itemId)) {
|
||||
await activeEffect.delete();
|
||||
}
|
||||
if (activeEffect.parent instanceof Actor) {
|
||||
const itemId = activeEffect.origin?.match(itemIdRegex)?.[1];
|
||||
if (activeEffect.parent.items.has(itemId)) {
|
||||
await activeEffect.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const migrateActor = getActorMigrator(undefined, migrateActiveEffect);
|
||||
|
@ -36,6 +36,6 @@ const migrateCompendium = getCompendiumMigrator({ migrateActor, migrateScene });
|
|||
|
||||
/** @type {import("./migration.js").Migration} */
|
||||
export const migration = {
|
||||
migrate,
|
||||
migrateCompendium,
|
||||
migrate,
|
||||
migrateCompendium,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue