feat: require JSDoc in new api (#50429)

Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
Naomi Carrigan
2023-08-03 09:20:54 -07:00
committed by GitHub
parent 2a13fefdf0
commit 0aa1ad0d09
23 changed files with 275 additions and 3 deletions

View File

@@ -1,5 +1,11 @@
export type ProgressTimestamp = number | { timestamp: number } | null;
/**
* Converts a ProgressTimestamp array to a object with keys based on the timestamps.
*
* @param progressTimestamps The ProgressTimestamp array.
* @returns The object with keys based on the timestamps.
*/
export const getCalendar = (
progressTimestamps: ProgressTimestamp[] | null
): Record<string, 1> => {
@@ -17,6 +23,12 @@ export const getCalendar = (
return calendar;
};
/**
* Converts a ProgressTimestamp array to an integer number of points.
*
* @param progressTimestamps The ProgressTimestamp array.
* @returns The number of points.
*/
export const getPoints = (
progressTimestamps: ProgressTimestamp[] | null
): number => {