* Convert database row to Node object
(row: NodeRow)
| 156 | * Convert database row to Node object |
| 157 | */ |
| 158 | function rowToNode(row: NodeRow): Node { |
| 159 | return { |
| 160 | id: row.id, |
| 161 | kind: row.kind as NodeKind, |
| 162 | name: row.name, |
| 163 | qualifiedName: row.qualified_name, |
| 164 | filePath: row.file_path, |
| 165 | language: row.language as Language, |
| 166 | startLine: row.start_line, |
| 167 | endLine: row.end_line, |
| 168 | startColumn: row.start_column, |
| 169 | endColumn: row.end_column, |
| 170 | docstring: row.docstring ?? undefined, |
| 171 | signature: row.signature ?? undefined, |
| 172 | visibility: row.visibility as Node['visibility'], |
| 173 | isExported: row.is_exported === 1, |
| 174 | isAsync: row.is_async === 1, |
| 175 | isStatic: row.is_static === 1, |
| 176 | isAbstract: row.is_abstract === 1, |
| 177 | decorators: row.decorators ? safeJsonParse(row.decorators, undefined) : undefined, |
| 178 | typeParameters: row.type_parameters ? safeJsonParse(row.type_parameters, undefined) : undefined, |
| 179 | returnType: row.return_type ?? undefined, |
| 180 | updatedAt: row.updated_at, |
| 181 | }; |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * Convert database row to Edge object |
no test coverage detected