(node: ast.Node)
| 168 | ) |
| 169 | |
| 170 | const parseType = (node: ast.Node) => { |
| 171 | let text = getTypeText(node) |
| 172 | for (const property of node.getDescendantsOfKind(ast.ts.SyntaxKind.PropertySignature)) { |
| 173 | if (!shouldIgnore(parseDoc(getJSDocText(property.getJsDocs())))) continue |
| 174 | const readonly = property.getFirstModifierByKind(ast.ts.SyntaxKind.ReadonlyKeyword) ? "readonly " : "" |
| 175 | const optional = property.hasQuestionToken() ? "?" : "" |
| 176 | const type = property.getTypeNode()?.getText() ?? getTypeText(property) |
| 177 | const signature = `${readonly}${property.getName()}${optional}: ${type}` |
| 178 | text = text |
| 179 | .replaceAll(`; ${signature}`, "") |
| 180 | .replaceAll(`${signature}; `, "") |
| 181 | .replaceAll(signature, "") |
| 182 | } |
| 183 | return text |
| 184 | } |
| 185 | |
| 186 | const getFunctionDeclarationJSDocs = (fd: ast.FunctionDeclaration): Array<ast.JSDoc> => |
| 187 | Array.matchLeft(fd.getOverloads(), { |
no test coverage detected