nativescript
Version:
Command-line interface for building NativeScript projects
26 lines • 874 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResourceLoader = void 0;
const path = require("path");
const yok_1 = require("./yok");
class ResourceLoader {
constructor($fs, $staticConfig) {
this.$fs = $fs;
this.$staticConfig = $staticConfig;
}
resolvePath(resourcePath) {
return path.join(this.$staticConfig.RESOURCE_DIR_PATH, resourcePath);
}
openFile(resourcePath) {
return this.$fs.createReadStream(this.resolvePath(resourcePath));
}
readText(resourcePath) {
return this.$fs.readText(this.resolvePath(resourcePath));
}
readJson(resourcePath) {
return this.$fs.readJson(this.resolvePath(resourcePath));
}
}
exports.ResourceLoader = ResourceLoader;
yok_1.injector.register("resources", ResourceLoader);
//# sourceMappingURL=resource-loader.js.map
;