-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[misc] fix linting issues and missing jsdoc
- Loading branch information
Showing
6 changed files
with
66 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
/** | ||
* A compare function that can be used with Array.prototype.sort to sort an array of numbers in ascending order. | ||
* | ||
* @param a - The first number for comparison. | ||
* @param b - The second number for comparison. | ||
* @returns The difference between `a` and `b`. | ||
*/ | ||
export const sortAsc = (a: number, b: number): number => a - b | ||
|
||
/** | ||
* A compare function that can be used with Array.prototype.sort to sort an array of numbers in descending order. | ||
* | ||
* @param a - The first number for comparison. | ||
* @param b - The second number for comparison. | ||
* @returns The difference between `b` and `a`. | ||
*/ | ||
export const sortDesc = (a: number, b: number): number => b - a | ||
|
||
/** | ||
* Calculates the sum of two numbers. | ||
* | ||
* @param accumulator - The initial value of the sum. | ||
* @param value - The value to be added to the sum. | ||
* @returns The sum of the accumulator and the value. | ||
*/ | ||
export const sum = (accumulator: number, value: number): number => accumulator + value |