@19h47/clamp

Clamps a value between an upper and lower bound

Usage no npm install needed!

<script type="module">
  import 19h47Clamp from 'https://cdn.skypack.dev/@19h47/clamp';
</script>

README

@19h47/clamp

@19h47/clamp is a small module to clamp a number between an upper and lower bound.

import clamp from '@19h47/clamp';

clamp(100, 0, 50); // 50

Test

yarn test