(unchanged: SnapshotUnchanged)
| 124 | } |
| 125 | |
| 126 | function formatUnchangedSnapshotText(unchanged: SnapshotUnchanged): string { |
| 127 | const age = formatSnapshotAge(unchanged.ageMs); |
| 128 | if (unchanged.scope) { |
| 129 | return [ |
| 130 | `Scoped snapshot unchanged for scope "${unchanged.scope}" since previous read ${age} ago.`, |
| 131 | 'Previous refs in this scope remain valid. Use find/get/is for a targeted query, or --force-full to re-emit.', |
| 132 | ].join('\n'); |
| 133 | } |
| 134 | if (unchanged.interactiveOnly) { |
| 135 | return [ |
| 136 | `Interactive snapshot unchanged since previous read ${age} ago.`, |
| 137 | `${unchanged.nodeCount} visible nodes are unchanged. Previous @e refs are still valid. Use find/get/is for a targeted query, or --force-full to re-emit.`, |
| 138 | ].join('\n'); |
| 139 | } |
| 140 | return [ |
| 141 | `Snapshot unchanged since previous read ${age} ago.`, |
| 142 | 'Refs from the previous snapshot are still valid. Use --force-full to re-emit the tree, or use find/get/is for a targeted query.', |
| 143 | ].join('\n'); |
| 144 | } |
| 145 | |
| 146 | function formatSnapshotAge(ageMs: number): string { |
| 147 | if (ageMs < 1000) return `${Math.round(ageMs)}ms`; |
no test coverage detected