JSPM

clamp-v2

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q63935F
  • License MIT

Clamp a value between two bounds

Package Exports

  • clamp-v2
  • clamp-v2/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (clamp-v2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.