UNPKG

@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>

27 lines 884 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getTargetForPlayground = getTargetForPlayground; const ts_morph_1 = require("ts-morph"); /** * * @param expression * @param playgroundId * @param playground */ function getTargetForPlayground(playground) { const target = playground.getProperty('target'); if (ts_morph_1.Node.isPropertyAssignment(target)) { const targetInitializer = target.getInitializer(); if (ts_morph_1.Node.isIdentifier(targetInitializer)) { const declaration = targetInitializer .getType() ?.getSymbol() ?.getDeclarations()[0]; if (ts_morph_1.Node.isClassDeclaration(declaration)) { return declaration; } } } return undefined; } //# sourceMappingURL=get-target-for-playground.js.map