Skip to content

Commit f7048f5

Browse files
committed
feat: Sort in sample and fix bugs
1 parent c77bae0 commit f7048f5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ps/commands/sample.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const command: PSCommand = {
1313
const nums =
1414
originalCommand[0] === 'random'
1515
? Array.from({ length: count }, () => sample(max) + 1)
16-
: Array.from({ length: count }, (_, index) => index + 1).sample(count);
17-
broadcast(nums.join(', '));
16+
: Array.from({ length: max }, (_, index) => index + 1).sample(count);
17+
broadcast(nums.sortBy(num => num, 'asc').join(', '));
1818
},
1919
};

0 commit comments

Comments
 (0)