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>

19 lines 767 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getVariableStatementFromObjectLiteralExpression = getVariableStatementFromObjectLiteralExpression; const ts_morph_1 = require("ts-morph"); /** * * @param objectLiteral */ function getVariableStatementFromObjectLiteralExpression(objectLiteral) { const parent = objectLiteral.getParent(); if (ts_morph_1.Node.isVariableDeclaration(parent)) { const statement = parent.getVariableStatement(); if (statement) { return statement; } } throw new Error(`Expected the object literal expression to be a child of a variable declaration, but it was not.`); } //# sourceMappingURL=get-variable-statement-from-object-literal-expression.js.map