UNPKG

@gmetrixr/rjson

Version:
24 lines (23 loc) 877 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const r_1 = require("../../../r"); /** * Converts whenEvent/thenAciton ce_id/ce_type to co_id/co_type */ class Migration { execute(projectJson) { const pJson = projectJson; const projectF = r_1.r.record(pJson); projectF.getAllDeepChildren(r_1.RT.when_event).forEach(we => { r_1.r.record(we).changePropertyName("ce_id", "co_id"); r_1.r.record(we).changePropertyName("ce_type", "co_type"); }); projectF.getAllDeepChildren(r_1.RT.then_action).forEach(ta => { r_1.r.record(ta).changePropertyName("ce_id", "co_id"); r_1.r.record(ta).changePropertyName("ce_type", "co_type"); }); projectF.set(r_1.rtp.project.version, 103); } } const migration = new Migration(); exports.default = migration;