Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

map

import { map } from "https://raw.githubusercontent.com/JOTSR/Denum/master/mod.ts";

Re-map a value from initial bounds to another bounds

function map(
value: number,
initialBounds: [number, number],
destinationBounds: [number, number],
): number;
function map(
value: bigint,
initialBounds: [bigint, bigint],
destinationBounds: [bigint, bigint],
): bigint;
function map<T extends number | bigint>(
value: T,
initialBounds: [T, T],
destinationBounds: [T, T],
): T;
§
map(value: number, initialBounds: [number, number], destinationBounds: [number, number]): number
[src]

Re-map a value from initial bounds to another bounds

§Parameters

§
value: number
[src]

Value to map

§
initialBounds: [number, number]
[src]

[min, max] initial bounds

§
destinationBounds: [number, number]
[src]

[min, max] destination bounds

§Return Type

§
number
[src]

Re-mapped value

§
map(value: bigint, initialBounds: [bigint, bigint], destinationBounds: [bigint, bigint]): bigint
[src]

Re-map a value from initial bounds to another bounds

§Parameters

§
value: bigint
[src]

Value to map

§
initialBounds: [bigint, bigint]
[src]

[min, max] initial bounds

§
destinationBounds: [bigint, bigint]
[src]

[min, max] destination bounds

§Return Type

§
bigint
[src]

Re-mapped value

§
map<T extends number | bigint>(value: T, initialBounds: [T, T], destinationBounds: [T, T]): T
[src]

§Type Parameters

§
T extends number | bigint
[src]

§Parameters

§
value: T
[src]
§
initialBounds: [T, T]
[src]
§
destinationBounds: [T, T]
[src]

§Return Type