Lint frontend
This commit is contained in:
@@ -8,17 +8,17 @@
|
||||
* @param wait Time in milliseconds to wait before calling the function
|
||||
* @returns Debounced function
|
||||
*/
|
||||
export function debounce<T extends (...args: any[]) => any>(
|
||||
export function debounce<T extends (..._args: unknown[]) => unknown>(
|
||||
func: T,
|
||||
wait: number
|
||||
): (...args: Parameters<T>) => void {
|
||||
): (..._args: Parameters<T>) => void {
|
||||
let timeout: ReturnType<typeof setTimeout> | null = null
|
||||
|
||||
return function (...args: Parameters<T>): void {
|
||||
return function (..._args: Parameters<T>): void {
|
||||
if (timeout) {
|
||||
clearTimeout(timeout)
|
||||
}
|
||||
timeout = setTimeout(() => func(...args), wait)
|
||||
timeout = setTimeout(() => func(..._args), wait)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ export function deepClone<T>(obj: T): T {
|
||||
* @param value Value to check
|
||||
* @returns True if value is empty
|
||||
*/
|
||||
export function isEmpty(value: any): boolean {
|
||||
export function isEmpty(value: unknown): boolean {
|
||||
if (value === null || value === undefined) return true
|
||||
if (typeof value === 'string' && value.trim() === '') return true
|
||||
if (Array.isArray(value) && value.length === 0) return true
|
||||
|
||||
Reference in New Issue
Block a user