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>

12 lines 484 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.firstNodeWithComment = firstNodeWithComment; const ts_morph_1 = require("ts-morph"); /** * Returns first node that has JSDoc comment, will return first node, if there are no comment nodes * @param nodes */ function firstNodeWithComment(nodes) { return nodes.find((n) => ts_morph_1.Node.isJSDocable(n) && n.getJsDocs().length) ?? nodes[0]; } //# sourceMappingURL=first-node-with-comment.js.map