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>

24 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPipeDecorator = getPipeDecorator; const ts_morph_1 = require("ts-morph"); const string_expression_1 = require("../string-expression"); const typescript_1 = require("../typescript"); /** * Resolves the pipe decorator and return its properties. * @param cls - class declaration */ function getPipeDecorator(cls) { const decorator = cls.getDecorator('Pipe'); const decoratorArgument = decorator?.getArguments()[0]; if (ts_morph_1.Node.isObjectLiteralExpression(decoratorArgument)) { const standaloneProperty = decoratorArgument.getProperty('standalone'); const nameProperty = decoratorArgument.getProperty('name'); return { standalone: (0, string_expression_1.stringExpression)((0, typescript_1.getPropertyAssignment)(standaloneProperty)), name: (0, string_expression_1.stringExpression)((0, typescript_1.getPropertyAssignment)(nameProperty)), }; } return undefined; } //# sourceMappingURL=get-pipe-decorator.js.map