(nodes: NodeEntity[], uid: string)
| 1 | import { NodeEntity } from '@protontech/drive-sdk'; |
| 2 | |
| 3 | export function findName(nodes: NodeEntity[], uid: string): string { |
| 4 | for (const node of nodes) { |
| 5 | if (node.uid === uid) { |
| 6 | return getName(node); |
| 7 | } |
| 8 | } |
| 9 | return uid; |
| 10 | } |
| 11 | |
| 12 | export function getName(node: NodeEntity): string { |
| 13 | const name = node.name.ok ? node.name.value : ''; |