convert to JSDoc comments
This commit is contained in:
10
sanitize.ts
10
sanitize.ts
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user