(k: number, withNote: readonly string[] = [])
| 203 | const entriesIn = (block: readonly string[]) => block.filter((l) => l.startsWith('- src/')).length; |
| 204 | /** Room for exactly `k` pointer entries (header, entries and tail) beside `withNote`. */ |
| 205 | const roomFor = (k: number, withNote: readonly string[] = []) => { |
| 206 | const full = fit(1e6, [], false).pointers; |
| 207 | const header = full.slice(0, 2); |
| 208 | return cost(withNote) + cost([...header, ...entries.slice(0, k), `- ... and ${entries.length - k + 20} more files`]); |
| 209 | }; |
| 210 | |
| 211 | it('a complete-source note keeps its precedence over the pointer list', () => { |
| 212 | const complete = note(330); |
no test coverage detected