Attribute Item Subtype #76
1 changed files with 5 additions and 0 deletions
5
module/utils/clamp.mjs
Normal file
5
module/utils/clamp.mjs
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
export function clamp(min, ideal, max) {
|
||||||
|
min ??= Number.NEGATIVE_INFINITY;
|
||||||
|
max ??= Number.POSITIVE_INFINITY;
|
||||||
|
return Math.max(min, Math.min(ideal, max));
|
||||||
|
};
|
||||||
Loading…
Add table
Add a link
Reference in a new issue