Merge fresh model into virtual grid's currentModels when paths match (normalized).
(model)
| 1405 | out.push(model); |
| 1406 | continue; |
| 1407 | } |
| 1408 | const keeper = seen.get(key); |
| 1409 | const keepHasId = keeper && keeper.id != null && keeper.id !== ''; |
| 1410 | const candHasId = model.id != null && model.id !== ''; |
| 1411 | if (!keepHasId && candHasId) { |
| 1412 | const idx = out.indexOf(keeper); |
| 1413 | if (idx !== -1) out[idx] = model; |
| 1414 | seen.set(key, model); |
| 1415 | } |
| 1416 | } |
| 1417 | return out; |
| 1418 | } |
| 1419 | |
| 1420 | /** Drop expand state for parent groups that no longer have 2+ distinct files. */ |
| 1421 | function pruneParentModelExpandedGroups(models) { |
no test coverage detected