· Homepage · Report Bug / Request Feature ·
@compactjs/limit limits any number to a given range. If it exceeds the range, it start back at 0 and equally starts from maximum value if it falls below 0.
Use it to easily calculate hours, minutes or degrees.
npm install @compactjs/limit
<script src="https://unpkg.com/@compactjs/limit/dist/index.umd.js"></script>
import { limit } from '@compactjs/limit';
// hours
limit(25, 24); // returns: 1
// degrees
limit(90 - 180, 360); // returns: 270
npm run test
👤 Timo Bechtel [email protected]
- Website: https://timobechtel.com
- Twitter: @TimoBechtel
- GitHub: @TimoBechtel
Contributions, issues and feature requests are welcome!
- Check issues
- Fork the Project
- Create your Feature Branch (
git checkout -b feat/AmazingFeature
) - Test your changes
npm run test
- Commit your Changes (
git commit -m 'feat: add amazingFeature'
) - Push to the Branch (
git push origin feat/AmazingFeature
) - Open a Pull Request
This project uses semantic-release for automated release versions. So commits in this project follow the Conventional Commits guidelines. I recommend using commitizen for automated commit messages.
Give a ⭐️ if this project helped you!
Distributed under the MIT License.
This README was generated with ❤️ by readme-md-generator