"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultState = void 0;
const f_1 = require("../../system/f/object/Dissoc/f");
const f_2 = require("../../system/f/object/Merge/f");
const f_3 = require("../../system/f/object/Set/f");
const specs_1 = require("../actions/specs");
exports.defaultState = {};
const addSpec = ({ name, spec }, state) => (0, f_3.default)(state, name, spec);
const removeSpec = ({ name }, state) => (0, f_1.default)(state, name);
const setSpecs = ({ specs }, state) => {
    return (0, f_2.default)(state, specs);
};
function default_1(state = exports.defaultState, { type, data }) {
    switch (type) {
        case specs_1.ADD_SPEC:
            return addSpec(data, state);
        case specs_1.REMOVE_SPEC:
            return removeSpec(data, state);
        case specs_1.SET_SPECS:
            return setSpecs(data, state);
        default:
            return state;
    }
}
exports.default = default_1;
//# sourceMappingURL=specs.js.map