(node: ts.Node)
| 2641 | } |
| 2642 | |
| 2643 | function normalizeFile(cwd: string, filename: string): string { |
| 2644 | return normalizePathName(path.relative(cwd, filename)) |
| 2645 | } |
| 2646 | |
| 2647 | function hashSource(source: string): string { |
| 2648 | return crypto.createHash("sha256").update(source).digest("hex") |
| 2649 | } |
| 2650 | |
| 2651 | function getNodeJSDoc(node: ts.Node): JSDocBlock | undefined { |
| 2652 | const jsDocs = (node as { readonly jsDoc?: ReadonlyArray<ts.JSDoc> }).jsDoc |
| 2653 | const jsDoc = jsDocs?.[jsDocs.length - 1] |
| 2654 | if (jsDoc === undefined) return undefined |
| 2655 | const source = node.getSourceFile().text |
| 2656 | return parseJSDocBlock(source.slice(jsDoc.pos, jsDoc.end), [jsDoc.pos, jsDoc.end]) |
| 2657 | } |
| 2658 | |
| 2659 | function addModelDiagnostics( |
| 2660 | out: Array<JSDocModelDiagnostic>, |
| 2661 | range: [number, number], |
| 2662 | diagnostics: ReadonlyArray<JSDocDiagnostic> |
| 2663 | ) { |
no test coverage detected
searching dependent graphs…