feat: replace custom clamp function with es-toolkit's clamp in multiple files

This commit is contained in:
2026-01-03 16:47:45 +00:00
parent eb4577a4c5
commit 94dec6c794
8 changed files with 9 additions and 30 deletions
+2 -9
View File
@@ -1,16 +1,9 @@
import type { RNG } from './RNG.js';
import { clamp } from 'es-toolkit';
const maxSafeInt = Number.MAX_SAFE_INTEGER;
const clamp01 = (value: number): number => {
if (value < 0) {
return 0;
}
if (value > 1) {
return 1;
}
return value;
};
const clamp01 = (value: number): number => clamp(value, 0, 1);
// 테스트에서 0/1만 고정으로 뽑기 위한 RNG
export class ConstantRNG implements RNG {