(labels: string[])
| 173 | } |
| 174 | |
| 175 | public *getVertices(labels: string[]): Iterable<StoredVertex> { |
| 176 | // Snapshot keys to prevent infinite loops when vertices are added during iteration. |
| 177 | // Keys are just strings so this is cheap; actual vertex data is still fetched lazily. |
| 178 | const keys = [...this.#vertices.keys()]; |
| 179 | for (const key of keys) { |
| 180 | const vertex = this.#vertices.get(key); |
| 181 | if ( |
| 182 | vertex !== undefined && |
| 183 | (labels.length === 0 || labels.includes(getLabelFromElementId(vertex.id))) |
| 184 | ) { |
| 185 | yield vertex; |
| 186 | } |
| 187 | } |
| 188 | } |
| 189 | |
| 190 | public *getVerticesByIds(ids: Iterable<ElementId>): Iterable<StoredVertex> { |
| 191 | for (const id of ids) { |
nothing calls this directly
no test coverage detected