UNPKG

angular-calendar

Version:

A calendar component for angular 20.2+ that can display events on a month, week or day view

21 lines (20 loc) 812 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getSourceFile = getSourceFile; 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; }