@anselan/maprange
Advanced tools
Comparing version 0.3.1 to 0.3.2
{ | ||
"name": "@anselan/maprange", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "Map values from one range to another", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -9,2 +9,15 @@ # Map Range in JS | ||
## Usage | ||
### Essentially: | ||
> **remap (value, inputRange, targetRante, clamp)** | ||
...where the parameters are: | ||
* `value`: a number | ||
* `inputRange`, `targetRange`: arrays of exactly 2 elements each, i.e `[min,max]` | ||
* `clamp` (optional; default `false`): whether to constrain the result within the given target range | ||
### Description | ||
Provide the range (`inputMin`, `inputMax`) that your `value` is currently in, and specify a new range (`outputMin`, `outputMax`) and you'll get back a new value as per the target range. | ||
## Installation | ||
@@ -24,15 +37,2 @@ ``` | ||
## Usage | ||
### Essentially: | ||
> **remap (value, inputRange, targetRante, clamp)** | ||
...where the parameters are: | ||
* `value`: a number | ||
* `inputRange`, `targetRange`: arrays of exactly 2 elements each, i.e `[min,max]` | ||
* `clamp` (optional; default `false`): whether to constrain the result within the given target range | ||
### Description | ||
Provide the range (`inputMin`, `inputMax`) that your `value` is currently in, and specify a new range (`outputMin`, `outputMax`) and you'll get back a new value as per the target range. | ||
## Useful example applications | ||
@@ -39,0 +39,0 @@ ### Percentages |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package