(aboveRank: RankLike, belowRank: RankLike)
| 389 | } |
| 390 | |
| 391 | function safeBetween(aboveRank: RankLike, belowRank: RankLike): string { |
| 392 | const aboveStr = aboveRank.toString(); |
| 393 | const belowStr = belowRank.toString(); |
| 394 | |
| 395 | try { |
| 396 | const result = aboveRank.between(belowRank).toString(); |
| 397 | if ( |
| 398 | compareRankStringsForBases(result, aboveStr) > 0 && |
| 399 | compareRankStringsForBases(result, belowStr) < 0 |
| 400 | ) { |
| 401 | return result; |
| 402 | } |
| 403 | } catch { |
| 404 | // Fall through to safer directional fallbacks. |
| 405 | } |
| 406 | |
| 407 | const next = safeGenNext(aboveRank).toString(); |
| 408 | if ( |
| 409 | compareRankStringsForBases(next, aboveStr) > 0 && |
| 410 | compareRankStringsForBases(next, belowStr) < 0 |
| 411 | ) |
| 412 | return next; |
| 413 | |
| 414 | const prev = safeGenPrev(belowRank).toString(); |
| 415 | if ( |
| 416 | compareRankStringsForBases(prev, aboveStr) > 0 && |
| 417 | compareRankStringsForBases(prev, belowStr) < 0 |
| 418 | ) |
| 419 | return prev; |
| 420 | |
| 421 | return next; |
| 422 | } |
| 423 | |
| 424 | function createRebalancePlan( |
| 425 | columnTasks: TaskInfo[], |
no test coverage detected