Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
math-clamp-x
Advanced tools
Clamp a number to limits.
module.exports(value, [min], max)
⇒ number
⏏This method clamp a number to min and max limits inclusive.
Kind: Exported function
Returns: number
- The clamped number.
Throws:
RangeError
If min > max.Param | Type | Default | Description |
---|---|---|---|
value | number | The number to be clamped. | |
[min] | number | 0 | The minimum number. |
max | number | The maximum number. |
Example
import mathClamp from 'math-clamp-x';
console.log(mathClamp(-5, 3, 3)); // 3
console.log(mathClamp(0, 3, 3)); // 3
console.log(mathClamp(5, 3, 3)); // 3
FAQs
Clamp a number to limits.
The npm package math-clamp-x receives a total of 4,649 weekly downloads. As such, math-clamp-x popularity was classified as popular.
We found that math-clamp-x demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.