"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Framework = void 0;
var Framework = /** @class */ (function () {
    function Framework(bundler, config, resolver) {
        var _this = this;
        this.stringify = require("json-stringify-safe");
        this.create = function (karmaConfig, logger) {
            _this.log = logger.create("framework.karma-typescript");
            config.initialize(karmaConfig);
            resolver.initialize();
            if (!config.hasFramework("commonjs")) {
                bundler.attach(karmaConfig.files);
            }
            config.bundlerOptions.transforms.forEach(function (t) {
                if (t.initialize) {
                    t.initialize({
                        appenders: config.logAppenders,
                        level: karmaConfig.logLevel
                    });
                }
            });
            _this.log.debug("Configuration:\n", _this.stringify(config, _this.replacer, 3));
        };
        this.create.$inject = ["config", "logger"];
    }
    Framework.prototype.replacer = function (key, value) {
        if (key && typeof value === "function") {
            return (value + "").substr(0, 100) + "...";
        }
        return value;
    };
    return Framework;
}());
exports.Framework = Framework;
//# sourceMappingURL=framework.js.map