@ng-doc/builder
Version:
<!-- PROJECT LOGO --> <br /> <div align="center"> <a href="https://github.com/ng-doc/ng-doc"> <img src="https://ng-doc.com/assets/images/ng-doc.svg?raw=true" alt="Logo" height="150px"> </a>
22 lines • 778 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTemplateForPlayground = getTemplateForPlayground;
const ts_morph_1 = require("ts-morph");
/**
*
* @param expression
* @param playgroundId
* @param playground
*/
function getTemplateForPlayground(playground) {
const template = playground.getProperty('template');
if (ts_morph_1.Node.isPropertyAssignment(template)) {
const templateInitializer = template.getInitializer();
if (ts_morph_1.Node.isStringLiteral(templateInitializer) ||
ts_morph_1.Node.isNoSubstitutionTemplateLiteral(templateInitializer)) {
return templateInitializer.getLiteralValue();
}
}
return '';
}
//# sourceMappingURL=get-template-for-playground.js.map
;