Wraps a number inside a range.
https://www.npmjs.com/package/@pelevesque/wrap-number
npm install @pelevesque/wrap-number
Command | Description |
---|---|
npm test or npm run test |
All Tests Below |
npm run cover |
Standard Style |
npm run standard |
Coverage |
npm run unit |
Unit Tests |
const wrapNumber = require('@pelevesque/wrap-number')
const num = 11
const rangeMin = -10
const rangeMax = 10
const result = wrapNumber(num, rangeMin, rangeMax)
// result === -10