mirror of
https://codeberg.org/uzu/strudel
synced 2026-07-13 06:19:33 -04:00
clamp function
This commit is contained in:
@@ -213,3 +213,5 @@ export const splitAt = function (index, value) {
|
||||
};
|
||||
|
||||
export const zipWith = (f, xs, ys) => xs.map((n, i) => f(n, ys[i]));
|
||||
|
||||
export const clamp = (num, min, max) => Math.min(Math.max(num, min), max);
|
||||
|
||||
Reference in New Issue
Block a user