"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const json1 = {
    name: {
        __old: "oldvalue",
        __new: "newvalue"
    }
};
const json2 = {
    name: "name",
    type: {
        __old: "oldtype",
        __new: "newtype"
    }
};
const json3 = {
    name: "name",
    defaultValue__added: "default"
};
const json4 = {
    name: "name",
    defaultValue: {
        __old: "default",
        __new: "default2"
    }
};
const json5 = {
    name: "name",
    defaultValue__deleted: "default2"
};
const json6 = {
    name: "name",
    notNull__added: true
};
const json7 = {
    name: "name",
    notNull: {
        __old: true,
        __new: false
    }
};
const json8 = {
    name: "name",
    notNull__deleted: false
};
const jsons = [json1, json2, json3, json4, json5, json6, json7, json8].map(it => {
    if (typeof it.name !== 'string' && '__old' in it.name) {
        // rename
        return { ...it, name: { type: 'changed', old: it.name.__old, new: it.name.__new } };
    }
    return it;
}).map(it => {
    if ('type' in it) {
        // type change
        return { ...it, type: { type: 'changed', old: it.type.__old, new: it.type.__new } };
    }
    return it;
}).map(it => {
    if ('defaultValue' in it) {
        return { ...it, defaultValue: { type: 'changed', old: it.defaultValue.__old, new: it.defaultValue.__new } };
    }
    if ('defaultValue__added' in it) {
        const { defaultValue__added, ...others } = it;
        return { ...others, defaultValue: { type: 'added', value: it.defaultValue__added } };
    }
    if ('defaultValue__deleted' in it) {
        const { defaultValue__deleted, ...others } = it;
        return { ...others, defaultValue: { type: 'deleted', value: it.defaultValue__deleted } };
    }
    return it;
}).map(it => {
    if ('notNull' in it) {
        return { ...it, notNull: { type: 'changed', old: it.notNull.__old, new: it.notNull.__new } };
    }
    if ('notNull__added' in it) {
        const { notNull__added, ...others } = it;
        return { ...others, notNull: { type: 'added', value: it.notNull__added } };
    }
    if ('notNull__deleted' in it) {
        const { notNull__deleted, ...others } = it;
        return { ...others, notNull: { type: 'deleted', value: it.notNull__deleted } };
    }
    return it;
}).map(it => it);
jsons.forEach(it => {
    if (it.notNull?.type === 'added') {
        console.log(it);
    }
});
//# sourceMappingURL=quokka.js.map