UNPKG

@gmetrixr/rjson

Version:
23 lines (22 loc) 915 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const r_1 = require("../../../r"); const project_1 = require("../../../r/definitions/project"); /** * Set avatar system to basic + custom if avatars are set already */ class Migration { execute(projectJson) { const pJson = projectJson; const projectF = r_1.r.project(pJson); const avatars = projectF.getRecords(r_1.RT.avatar); const avatarSystem = projectF.get(r_1.rtp.project.avatar_system); // * if avatar system is undefined and avatars have been added, then set the avatar system to basic_custom if (avatars.length > 0 && avatarSystem === undefined) { projectF.set(r_1.rtp.project.avatar_system, project_1.AvatarSystem.basic_custom); } projectF.set(r_1.rtp.project.version, 147); } } const migration = new Migration(); exports.default = migration;