Skip to content
This repository was archived by the owner on Feb 14, 2026. It is now read-only.

Commit 8416183

Browse files
committed
fix(flex): remove unreachable condition in applyAlignment
Remove unreachable condition that checked if lineWidth < containerWidth inside a block where availableSpace <= 0 (which means lineWidth >= containerWidth). Simplify to just return the line without padding when it meets or exceeds width.
1 parent 71e698a commit 8416183

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/Flex.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -522,10 +522,7 @@ export class Flex implements Component {
522522
const availableSpace = containerWidth - lineWidth;
523523

524524
if (availableSpace <= 0) {
525-
// If line is already at or exceeds container width, pad to exact width
526-
if (lineWidth < containerWidth) {
527-
return line + ' '.repeat(containerWidth - lineWidth);
528-
}
525+
// Line is at or exceeds container width; no additional padding applied
529526
return line;
530527
}
531528

0 commit comments

Comments
 (0)