"use strict";
const first = ['users', 'cities', 'redundant_table'];
const second = ['users1', 'cities1', 'subscriptions'];
const sequence = ['0-0', '1-1', '2-', '-2'];
const applier = (f1, f2, seq) => {
    const created = [];
    const deleted = [];
    const renamed = [];
    for (const item of seq) {
        const split = item.split('-', 2);
        if (split[0] && split[1]) {
            // rename
            const renameFrom = f1[split[0]];
            const renameTo = f2[split[1]];
            renamed.push({ from: renameFrom, to: renameTo });
        }
        else if (split[0]) {
            // delete
            deleted.push(f1[split[0]]);
        }
        else if (split[1]) {
            // create
            created.push(f2[split[1]]);
        }
    }
    return { created, deleted, renamed };
};
const result = applier(first, second, sequence);
console.log(result);
//# sourceMappingURL=serialiser.js.map