* Convert database row to Node object
(row: NodeRow)
| 129 | * Convert database row to Node object |
| 130 | */ |
| 131 | function rowToNode(row: NodeRow): Node { |
| 132 | return { |
| 133 | id: row.id, |
| 134 | kind: row.kind as NodeKind, |
| 135 | name: row.name, |
| 136 | qualifiedName: row.qualified_name, |
| 137 | filePath: row.file_path, |
| 138 | language: row.language as Language, |
| 139 | startLine: row.start_line, |
| 140 | endLine: row.end_line, |
| 141 | startColumn: row.start_column, |
| 142 | endColumn: row.end_column, |
| 143 | docstring: row.docstring ?? undefined, |
| 144 | signature: row.signature ?? undefined, |
| 145 | visibility: row.visibility as Node['visibility'], |
| 146 | isExported: row.is_exported === 1, |
| 147 | isAsync: row.is_async === 1, |
| 148 | isStatic: row.is_static === 1, |
| 149 | isAbstract: row.is_abstract === 1, |
| 150 | decorators: row.decorators ? safeJsonParse(row.decorators, undefined) : undefined, |
| 151 | typeParameters: row.type_parameters ? safeJsonParse(row.type_parameters, undefined) : undefined, |
| 152 | returnType: row.return_type ?? undefined, |
| 153 | updatedAt: row.updated_at, |
| 154 | }; |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Convert database row to Edge object |
no test coverage detected