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
@@ -37,6 +37,7 @@ import type { TurnCommandEnv } from '@sammo-ts/logic/actions/turn/commandEnv.js'
import type { NationTurnCommandSpec } from './index.js';
import { JosaUtil } from '@sammo-ts/common';
import type { ActionContextBuilder } from '@sammo-ts/logic/actions/turn/actionContext.js';
import { clamp } from 'es-toolkit';
export interface AwardArgs {
isGold: boolean;
@@ -68,9 +69,6 @@ const roundToUnit = (value: number, unit: number): number =>
const formatNumber = (value: number): string =>
value.toLocaleString('en-US');
const clamp = (value: number, min: number, max: number): number =>
Math.min(Math.max(value, min), max);
const normalizeAmount = (
amount: number,
env: AwardEnvironment