0.0.3 • Published 12 months ago

clamp-v2 v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

clamp-v2

Clamp a value between two bounds.

CI npm

Installation

pnpm add clamp-v2

Usage

import clamp from "clamp-v2";

clamp(1, 5, 10); // => 5
clamp(20, 5, 10); // => 10
clamp(8, 5, 10); // => 8

API

clamp(value, min, max)

Clamp a number between two given minimum and maximum bound.

Parameters:

1. value

Type: number \ The number to be clamped.

2. min

Type: number \ The minimum bound.

3. max

Type: number \ The maximum bound.

0.0.3

12 months ago

0.0.2

12 months ago

0.0.1

12 months ago