bot/utils/shuffle.ts → Shuffle.ts 대문자 통일
리눅스 빌드 환경에서 대소문자 잔존 파일과 충돌(TS1261)을 막기 위해 파일명을 PascalCase 로 통일하고 import 경로도 동일하게 수정.
This commit is contained in:
8
bot/src/utils/Shuffle.ts
Normal file
8
bot/src/utils/Shuffle.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/** Fisher-Yates 셔플 (in-place) */
|
||||
export const shuffle = <T>(list: T[]): T[] => {
|
||||
for (let i = list.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[list[i], list[j]] = [list[j], list[i]];
|
||||
}
|
||||
return list;
|
||||
}
|
||||
Reference in New Issue
Block a user