Code coverage report for lib/common/resource-loader.js

Statements: 81.25% (13 / 16)      Branches: 100% (0 / 0)      Functions: 50% (3 / 6)      Lines: 81.25% (13 / 16)      Ignored: none     

All files » lib/common/ » resource-loader.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25    1 1 1 8 8   1 5   1     1     1     1   1 1  
///<reference path=".d.ts"/>
"use strict";
var path = require("path");
var ResourceLoader = (function () {
    function ResourceLoader($fs, $staticConfig) {
        this.$fs = $fs;
        this.$staticConfig = $staticConfig;
    }
    ResourceLoader.prototype.resolvePath = function (resourcePath) {
        return path.join(this.$staticConfig.RESOURCE_DIR_PATH, resourcePath);
    };
    ResourceLoader.prototype.openFile = function (resourcePath) {
        return this.$fs.createReadStream(this.resolvePath(resourcePath));
    };
    ResourceLoader.prototype.readJson = function (resourcePath) {
        return this.$fs.readJson(this.resolvePath(resourcePath));
    };
    ResourceLoader.prototype.getPathToAppResources = function (framework) {
        return path.join(this.resolvePath(framework), this.$staticConfig.APP_RESOURCES_DIR_NAME);
    };
    return ResourceLoader;
})();
exports.ResourceLoader = ResourceLoader;
$injector.register("resources", ResourceLoader);