UNPKG

gamekit-utils

Version:

Minimal, fast and useful utilities for randomness, array manipulation and math — built for games, UI logic and generative design.

10 lines (9 loc) 239 B
/** * Clamps a number between min and max bounds. * * @example * clamp(5, 1, 10) // → 5 * clamp(-2, 0, 10) // → 0 * clamp(12, 0, 10) // → 10 */ export declare function clamp(val: number, min: number, max: number): number;