1.0.0 • Published 10 years ago
wrap-clamp v1.0.0
wrap-clamp
A simple wrapping clamp library that will wrap the value if it exceeds the bounds.
var wrapClamp = require('wrap-clamp');
wrapClamp(4, 0, 4); // prints 4
wrapClamp(5, 0, 4); // prints 0
wrapClamp(6, 0, 4); // prints 1
1.0.0
10 years ago