"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.injectUserBundle = injectUserBundle;
exports.injectUserSpecs = injectUserSpecs;
const weakMerge_1 = require("./weakMerge");
function injectUserBundle(registry, bundle) {
    const { spec, specs = {} } = bundle;
    const specs_ = (0, weakMerge_1.weakMerge)(specs, { [spec.id]: spec });
    return injectUserSpecs(registry, specs_);
}
function injectUserSpecs(registry, specs) {
    const specIdMap = registry.injectSpecs(specs);
    // lock spec to prevent deletion
    for (const specId in specs) {
        registry.lockSpec(specId);
    }
    return specIdMap;
}
//# sourceMappingURL=injectBundle.js.map