* Convert database row to Node object
(row: NodeRow)
| 196 | * Convert database row to Node object |
| 197 | */ |
| 198 | function rowToNode(row: NodeRow): Node { |
| 199 | return { |
| 200 | id: row.id, |
| 201 | kind: row.kind as NodeKind, |
| 202 | name: row.name, |
| 203 | qualifiedName: row.qualified_name, |
| 204 | filePath: row.file_path, |
| 205 | language: row.language as Language, |
| 206 | startLine: row.start_line, |
| 207 | endLine: row.end_line, |
| 208 | startColumn: row.start_column, |
| 209 | endColumn: row.end_column, |
| 210 | docstring: row.docstring ?? undefined, |
| 211 | signature: row.signature ?? undefined, |
| 212 | visibility: row.visibility as Node['visibility'], |
| 213 | isExported: row.is_exported === 1, |
| 214 | isAsync: row.is_async === 1, |
| 215 | isStatic: row.is_static === 1, |
| 216 | isAbstract: row.is_abstract === 1, |
| 217 | decorators: row.decorators ? safeJsonParse(row.decorators, undefined) : undefined, |
| 218 | typeParameters: row.type_parameters ? safeJsonParse(row.type_parameters, undefined) : undefined, |
| 219 | returnType: row.return_type ?? undefined, |
| 220 | updatedAt: row.updated_at, |
| 221 | }; |
| 222 | } |
| 223 | |
| 224 | /** |
| 225 | * rowToNode for rows that arrive as arrays, whose columns are in `columns` order. |
no test coverage detected