(input: string)
| 135 | } |
| 136 | |
| 137 | export function normalizeRef(input: string): string | null { |
| 138 | const trimmed = input.trim(); |
| 139 | if (trimmed.startsWith('@')) { |
| 140 | const ref = trimmed.slice(1); |
| 141 | return ref ? ref : null; |
| 142 | } |
| 143 | if (trimmed.startsWith('e')) return trimmed; |
| 144 | return null; |
| 145 | } |
| 146 | |
| 147 | export function findNodeByRef(nodes: SnapshotNode[], ref: string): SnapshotNode | null { |
| 148 | return nodes.find((node) => node.ref === ref) ?? null; |
no test coverage detected
searching dependent graphs…