Skip to content

Commit

Permalink
feat: add clamp function (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatiusmb authored Jul 24, 2024
1 parent 9e52949 commit 49bcc1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions workspace/mauss/src/math/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
export { permutation } from './set/index.js';

export function clamp(min: number, max: number) {
return (value: number) => Math.max(min, Math.min(value, max));
}

0 comments on commit 49bcc1a

Please sign in to comment.