Add jsdoc and unit tests for util functions

This commit is contained in:
2024-12-02 14:10:59 +01:00
parent 618fbe0102
commit e8b91bae4f
4 changed files with 192 additions and 11 deletions
+5
View File
@@ -1,3 +1,8 @@
/**
* Returns a random integer between from and to, including from, excluding to.
* @param fromInclusive Lower bound, inclusive.
* @param toExclusive Upper Bound, exclusive.
*/
export function randomInt(fromInclusive: number, toExclusive: number): number {
return (
Math.floor(Math.random() * (toExclusive - fromInclusive)) + fromInclusive