* Convert database row to Node object
(row: NodeRow)
| 114 | * Convert database row to Node object |
| 115 | */ |
| 116 | function rowToNode(row: NodeRow): Node { |
| 117 | return { |
| 118 | id: row.id, |
| 119 | kind: row.kind as NodeKind, |
| 120 | name: row.name, |
| 121 | qualifiedName: row.qualified_name, |
| 122 | filePath: row.file_path, |
| 123 | language: row.language as Language, |
| 124 | startLine: row.start_line, |
| 125 | endLine: row.end_line, |
| 126 | startColumn: row.start_column, |
| 127 | endColumn: row.end_column, |
| 128 | docstring: row.docstring ?? undefined, |
| 129 | signature: row.signature ?? undefined, |
| 130 | visibility: row.visibility as Node['visibility'], |
| 131 | isExported: row.is_exported === 1, |
| 132 | isAsync: row.is_async === 1, |
| 133 | isStatic: row.is_static === 1, |
| 134 | isAbstract: row.is_abstract === 1, |
| 135 | decorators: row.decorators ? safeJsonParse(row.decorators, undefined) : undefined, |
| 136 | typeParameters: row.type_parameters ? safeJsonParse(row.type_parameters, undefined) : undefined, |
| 137 | returnType: row.return_type ?? undefined, |
| 138 | updatedAt: row.updated_at, |
| 139 | }; |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Convert database row to Edge object |
no test coverage detected