All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.lib.utils.within.js.flow Maven / Gradle / Ivy

There is a newer version: 2.11.8
Show newest version
// @flow
import { max as mathMax, min as mathMin } from './math';

export function within(min: number, value: number, max: number): number {
  return mathMax(min, mathMin(value, max));
}

export function withinMaxClamp(min: number, value: number, max: number) {
  const v = within(min, value, max);
  return v > max ? max : v;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy