"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloneUnitBundle = cloneUnitBundle;
exports._cloneUnitBundle = _cloneUnitBundle;
exports.cloneUnitClass = cloneUnitClass;
const bundleClass_1 = require("./spec/bundleClass");
const clone_1 = require("./util/clone");
function cloneUnitBundle(Bundle, specs) {
    const { __bundle } = Bundle;
    const bundle = (0, clone_1.clone)(__bundle);
    return _cloneUnitBundle(Bundle, bundle, specs);
}
function _cloneUnitBundle(Bundle, bundle, specs) {
    const NewClass = cloneUnitClass(Bundle);
    const NewBundle = (0, bundleClass_1.bundleClass)(NewClass, bundle, specs);
    return NewBundle;
}
function cloneUnitClass(Class) {
    class NewClass extends Class {
    }
    Object.defineProperty(NewClass, 'name', { value: Class.constructor.name });
    return NewClass;
}
//# sourceMappingURL=cloneUnitClass.js.map