source: node_modules/es-toolkit/dist/math/clamp.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 187 bytes
RevLine 
[a762898]1function clamp(value, bound1, bound2) {
2 if (bound2 == null) {
3 return Math.min(value, bound1);
4 }
5 return Math.min(Math.max(value, bound1), bound2);
6}
7
8export { clamp };
Note: See TracBrowser for help on using the repository browser.