angular-calendar
Version:
A calendar component for angular 15.0+ that can display events on a month, week or day view
22 lines (21 loc) • 808 B
JavaScript
;
exports.__esModule = true;
exports.getSourceFile = void 0;
var ts = require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript");
var schematics_1 = require("@angular-devkit/schematics");
/**
* Reads file from given path and Returns TypeScript source file.
* @param host {Tree} The source tree.
* @param path {String} The path to the file to read. Relative to the root of the tree.
*
*/
function getSourceFile(host, path) {
var buffer = host.read(path);
if (!buffer) {
throw new schematics_1.SchematicsException("Could not find ".concat(path, "!"));
}
var content = buffer.toString();
var sourceFile = ts.createSourceFile(path, content, ts.ScriptTarget.Latest, true);
return sourceFile;
}
exports.getSourceFile = getSourceFile;