Skip to main content
Module

x/fae/mod.ts>clamp

A functional module for Deno inspired from Ramda.
Latest
variable clamp
import { clamp } from "https://deno.land/x/fae@v1.1.1/mod.ts";

Restricts value between min and max. Returns min if value < min, max if value > max, value otherwise

 Fae.clamp(1, 10, -5) // => 1
 Fae.clamp(1, 10, 15) // => 10
 Fae.clamp(1, 10, 4)  // => 4

type

Clamp