(docValue: string, type: ts.Type)
| 154 | } |
| 155 | |
| 156 | export function parseCommentDocValue(docValue: string, type: ts.Type) { |
| 157 | let value = docValue.replace(/'/g, '"').trim(); |
| 158 | |
| 159 | if (!type || !isString(type)) { |
| 160 | try { |
| 161 | value = JSON.parse(value); |
| 162 | } catch { |
| 163 | // Do nothing |
| 164 | } |
| 165 | } else if (isString(type)) { |
| 166 | if (value.split(' ').length !== 1 && !value.startsWith('"')) { |
| 167 | value = null; |
| 168 | } else { |
| 169 | value = value.replace(/"/g, ''); |
| 170 | } |
| 171 | } |
| 172 | return value; |
| 173 | } |
| 174 | |
| 175 | export function getTsDocTagsOfNode(node: Node, typeChecker: TypeChecker) { |
| 176 | const docComment = getDocComment(node); |
no test coverage detected
searching dependent graphs…