1.0.2 • Published 7 years ago

mima v1.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

mima

Make sure that a number is between min and max

Build Status Test Coverage

bitHound Code bitHound Overall Score bitHound Dependencies bitHound Dev Dependencies License: MIT

Install

npm i mima --save

mima(min, x, max)

  • min <number|null|undefined>
  • x <number>
  • max <number|null|undefined>

If x is smaller than min then min is returned. If x is between min and max then x is returned. If x is bigger than max then max is returned.

Example

const mima = require('mima')

mima(0, -100, 1) // 0
// because -100 is smaller than 0

mima(0, 1, 2) // 1
// because 1 is between 0 and 2

mima(0, 0.3, 1) // 0.3
// because 0.3 is between 0 and 1

mima(5, 100, 10) // 10
// because 100 is bigger than 10
1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.1

7 years ago