convert to JSDoc comments

This commit is contained in:
Elijah Duffy
2025-07-01 15:07:57 -07:00
parent c01dd71023
commit ff880c3cbf
2 changed files with 100 additions and 61 deletions

View File

@@ -1,3 +1,13 @@
/**
* Sanitizes a FormData value by key, returning a trimmed string.
* If the key is not present, it throws an error or returns a fallback value.
* @param data - The FormData object to sanitize.
* @param key - The key to look for in the FormData.
* @param fallback - Optional fallback value to return if the key is not found.
* @returns The sanitized string value or the fallback value.
* @throws Error if the key is required and not found.
* @template Fallback - The type of the fallback value.
*/
export function sanitize(data: FormData, key: string): string;
export function sanitize<Fallback>(
data: FormData,